mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish
See gh-14621
This commit is contained in:
parent
da1fde6a5f
commit
1eca492c5e
@ -84,11 +84,13 @@ public final class WebFluxTags {
|
||||
return Tag.of("uri", pathPattern.getPatternString());
|
||||
}
|
||||
HttpStatus status = exchange.getResponse().getStatusCode();
|
||||
if (status != null && status.is3xxRedirection()) {
|
||||
return URI_REDIRECTION;
|
||||
}
|
||||
if (status != null && status.equals(HttpStatus.NOT_FOUND)) {
|
||||
return URI_NOT_FOUND;
|
||||
if (status != null) {
|
||||
if (status.is3xxRedirection()) {
|
||||
return URI_REDIRECTION;
|
||||
}
|
||||
if (status == HttpStatus.NOT_FOUND) {
|
||||
return URI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
String path = exchange.getRequest().getPath().value();
|
||||
if (path.isEmpty()) {
|
||||
|
@ -90,13 +90,15 @@ public final class WebMvcTags {
|
||||
if (pattern != null) {
|
||||
return Tag.of("uri", pattern);
|
||||
}
|
||||
else if (response != null) {
|
||||
if (response != null) {
|
||||
HttpStatus status = extractStatus(response);
|
||||
if (status != null && status.is3xxRedirection()) {
|
||||
return URI_REDIRECTION;
|
||||
}
|
||||
if (status != null && status.equals(HttpStatus.NOT_FOUND)) {
|
||||
return URI_NOT_FOUND;
|
||||
if (status != null) {
|
||||
if (status.is3xxRedirection()) {
|
||||
return URI_REDIRECTION;
|
||||
}
|
||||
if (status == HttpStatus.NOT_FOUND) {
|
||||
return URI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
}
|
||||
String pathInfo = getPathInfo(request);
|
||||
|
@ -54,10 +54,9 @@ public class EmbeddedDataSourceConfiguration implements BeanClassLoaderAware {
|
||||
|
||||
@Bean
|
||||
public EmbeddedDatabase dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
this.database = new EmbeddedDatabaseBuilder()
|
||||
.setType(EmbeddedDatabaseConnection.get(this.classLoader).getType())
|
||||
.setName(this.properties.determineDatabaseName());
|
||||
this.database = builder.build();
|
||||
.setName(this.properties.determineDatabaseName()).build();
|
||||
return this.database;
|
||||
}
|
||||
|
||||
|
@ -128,13 +128,12 @@ public class ConditionEvaluationReportLoggingListener
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isCrashReport && this.logger.isInfoEnabled()
|
||||
&& !this.logger.isDebugEnabled()) {
|
||||
logMessage("debug");
|
||||
}
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug(new ConditionEvaluationReportMessage(this.report));
|
||||
}
|
||||
else if (isCrashReport) {
|
||||
logMessage("debug");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7665,11 +7665,11 @@ to print the report in auto-configuration tests.
|
||||
@Test
|
||||
public void autoConfigTest {
|
||||
ConditionEvaluationReportLoggingListener initializer = new ConditionEvaluationReportLoggingListener(
|
||||
LogLevel.INFO);
|
||||
ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withInitializer(initializer).run((context -> {
|
||||
// Do something...
|
||||
}));
|
||||
LogLevel.INFO);
|
||||
ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withInitializer(initializer).run((context) -> {
|
||||
// Do something...
|
||||
});
|
||||
}
|
||||
----
|
||||
|
||||
|
@ -61,16 +61,14 @@ public class AutoConfigureTestDatabaseWithMultipleDatasourcesIntegrationTests {
|
||||
@Bean
|
||||
@Primary
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.HSQL);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DataSource secondaryDataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.HSQL);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,9 +33,8 @@ public class ExampleJdbcApplication {
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.HSQL);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,9 +60,8 @@ public class JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTest
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.H2);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.H2).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,9 +62,8 @@ public class JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationT
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.H2);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.H2).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,9 +73,8 @@ public class TestDatabaseAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.HSQL);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,9 +33,8 @@ public class ExampleJooqApplication {
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.HSQL);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,9 +33,8 @@ public class ExampleDataJpaApplication {
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder()
|
||||
.generateUniqueName(true).setType(EmbeddedDatabaseType.HSQL);
|
||||
return builder.build();
|
||||
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
|
||||
.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user