Merge pull request #14621 from izeye

* pr/14621:
  Polish
pull/14583/merge
Stephane Nicoll 6 years ago
commit 7163fe1f46

@ -84,12 +84,14 @@ public final class WebFluxTags {
return Tag.of("uri", pathPattern.getPatternString());
}
HttpStatus status = exchange.getResponse().getStatusCode();
if (status != null && status.is3xxRedirection()) {
if (status != null) {
if (status.is3xxRedirection()) {
return URI_REDIRECTION;
}
if (status != null && status.equals(HttpStatus.NOT_FOUND)) {
if (status == HttpStatus.NOT_FOUND) {
return URI_NOT_FOUND;
}
}
String path = exchange.getRequest().getPath().value();
if (path.isEmpty()) {
return URI_ROOT;

@ -90,15 +90,17 @@ 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()) {
if (status != null) {
if (status.is3xxRedirection()) {
return URI_REDIRECTION;
}
if (status != null && status.equals(HttpStatus.NOT_FOUND)) {
if (status == HttpStatus.NOT_FOUND) {
return URI_NOT_FOUND;
}
}
}
String pathInfo = getPathInfo(request);
if (pathInfo.isEmpty()) {
return URI_ROOT;

@ -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");
}
}
}
}

@ -7667,9 +7667,9 @@ to print the report in auto-configuration tests.
ConditionEvaluationReportLoggingListener initializer = new ConditionEvaluationReportLoggingListener(
LogLevel.INFO);
ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withInitializer(initializer).run((context -> {
.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…
Cancel
Save