Commit 33577589 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Polish

See gh-14667
parent b4a8ad06
...@@ -128,10 +128,11 @@ public final class WebFluxTags { ...@@ -128,10 +128,11 @@ public final class WebFluxTags {
} }
/** /**
* Creates a {@code outcome} tag based on the response status of the given * Creates an {@code outcome} tag based on the response status of the given
* {@code exchange}. * {@code exchange}.
* @param exchange the exchange * @param exchange the exchange
* @return the outcome tag derived from the response status * @return the outcome tag derived from the response status
* @since 2.1.0
*/ */
public static Tag outcome(ServerWebExchange exchange) { public static Tag outcome(ServerWebExchange exchange) {
HttpStatus status = exchange.getResponse().getStatusCode(); HttpStatus status = exchange.getResponse().getStatusCode();
......
...@@ -165,9 +165,10 @@ public final class WebMvcTags { ...@@ -165,9 +165,10 @@ public final class WebMvcTags {
} }
/** /**
* Creates a {@code outcome} tag based on the status of the given {@code response}. * Creates an {@code outcome} tag based on the status of the given {@code response}.
* @param response the HTTP response * @param response the HTTP response
* @return the outcome tag derived from the status of the response * @return the outcome tag derived from the status of the response
* @since 2.1.0
*/ */
public static Tag outcome(HttpServletResponse response) { public static Tag outcome(HttpServletResponse response) {
if (response != null) { if (response != null) {
...@@ -181,7 +182,7 @@ public final class WebMvcTags { ...@@ -181,7 +182,7 @@ public final class WebMvcTags {
if (status < 400) { if (status < 400) {
return OUTCOME_REDIRECTION; return OUTCOME_REDIRECTION;
} }
else if (status < 500) { if (status < 500) {
return OUTCOME_CLIENT_ERROR; return OUTCOME_CLIENT_ERROR;
} }
return OUTCOME_SERVER_ERROR; return OUTCOME_SERVER_ERROR;
......
...@@ -156,7 +156,7 @@ public class Neo4jDataAutoConfigurationTests { ...@@ -156,7 +156,7 @@ public class Neo4jDataAutoConfigurationTests {
} }
@Test @Test
public void providesARequestScopedBookmarkManangerIfNecessaryAndPossible() { public void providesARequestScopedBookmarkManagerIfNecessaryAndPossible() {
this.contextRunner this.contextRunner
.withUserConfiguration(BookmarkManagementEnabledConfiguration.class) .withUserConfiguration(BookmarkManagementEnabledConfiguration.class)
.run((context) -> { .run((context) -> {
...@@ -168,7 +168,7 @@ public class Neo4jDataAutoConfigurationTests { ...@@ -168,7 +168,7 @@ public class Neo4jDataAutoConfigurationTests {
} }
@Test @Test
public void providesASingletonScopedBookmarkManangerIfNecessaryAndPossible() { public void providesASingletonScopedBookmarkManagerIfNecessaryAndPossible() {
new ApplicationContextRunner() new ApplicationContextRunner()
.withUserConfiguration(TestConfiguration.class, .withUserConfiguration(TestConfiguration.class,
BookmarkManagementEnabledConfiguration.class) BookmarkManagementEnabledConfiguration.class)
......
...@@ -130,7 +130,7 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe ...@@ -130,7 +130,7 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
for (Entry<String, ClassLoaderFile> entry : sourceFolder.getFilesEntrySet()) { for (Entry<String, ClassLoaderFile> entry : sourceFolder.getFilesEntrySet()) {
String name = entry.getKey(); String name = entry.getKey();
ClassLoaderFile file = entry.getValue(); ClassLoaderFile file = entry.getValue();
if (entry.getValue().getKind() != Kind.DELETED if (file.getKind() != Kind.DELETED
&& this.antPathMatcher.match(trimmedLocationPattern, name)) { && this.antPathMatcher.match(trimmedLocationPattern, name)) {
URL url = new URL("reloaded", null, -1, "/" + name, URL url = new URL("reloaded", null, -1, "/" + name,
new ClassLoaderFileURLStreamHandler(file)); new ClassLoaderFileURLStreamHandler(file));
......
...@@ -22,11 +22,11 @@ repositories { ...@@ -22,11 +22,11 @@ repositories {
dependencies { dependencies {
implementation localGroovy() implementation localGroovy()
implementation gradleApi() implementation gradleApi()
implementation fileTree(dir: 'target/dependencies/compile', include: '*.jar') implementation fileTree(dir: 'target/dependencies/compile', include: '*.jar')
testImplementation gradleTestKit() testImplementation gradleTestKit()
testImplementation 'org.apache.commons:commons-compress:1.13' testImplementation 'org.apache.commons:commons-compress:1.13'
testImplementation fileTree(dir: 'target/dependencies/test', include: '*.jar') testImplementation fileTree(dir: 'target/dependencies/test', include: '*.jar')
} }
jar { jar {
......
...@@ -99,17 +99,15 @@ final class BindConverter { ...@@ -99,17 +99,15 @@ final class BindConverter {
new ResolvableTypeDescriptor(type, annotations)); new ResolvableTypeDescriptor(type, annotations));
} }
public static BindConverter get(ConversionService conversionService, static BindConverter get(ConversionService conversionService,
Consumer<PropertyEditorRegistry> propertyEditorInitializer) { Consumer<PropertyEditorRegistry> propertyEditorInitializer) {
if (conversionService == ApplicationConversionService.getSharedInstance() if (conversionService == ApplicationConversionService.getSharedInstance()
&& propertyEditorInitializer == null) { && propertyEditorInitializer == null) {
BindConverter instance = sharedInstance; if (sharedInstance == null) {
if (instance == null) { sharedInstance = new BindConverter(conversionService,
instance = new BindConverter(conversionService,
propertyEditorInitializer); propertyEditorInitializer);
sharedInstance = instance;
} }
return instance; return sharedInstance;
} }
return new BindConverter(conversionService, propertyEditorInitializer); return new BindConverter(conversionService, propertyEditorInitializer);
} }
......
...@@ -101,6 +101,7 @@ public enum DatabaseDriver { ...@@ -101,6 +101,7 @@ public enum DatabaseDriver {
/** /**
* SAP - SAP Hana Database - HDB. * SAP - SAP Hana Database - HDB.
* @since 2.1.0
*/ */
SAP("HDB", "com.sap.db.jdbc.Driver", "com.sap.db.jdbcext.XADataSourceSAP", SAP("HDB", "com.sap.db.jdbc.Driver", "com.sap.db.jdbcext.XADataSourceSAP",
"SELECT 1 FROM DUMMY"), "SELECT 1 FROM DUMMY"),
......
...@@ -161,15 +161,13 @@ public class DevToolsIntegrationTests { ...@@ -161,15 +161,13 @@ public class DevToolsIntegrationTests {
String.class)).isEqualTo("two"); String.class)).isEqualTo("two");
controller("com.example.ControllerOne").withRequestMapping("one") controller("com.example.ControllerOne").withRequestMapping("one")
.withRequestMapping("three").build(); .withRequestMapping("three").build();
int port = awaitServerPort(); urlBase = "http://localhost:" + awaitServerPort();
assertThat( assertThat(template.getForObject(urlBase + "/one", String.class))
template.getForObject("http://localhost:" + port + "/one", String.class)) .isEqualTo("one");
.isEqualTo("one"); assertThat(template.getForObject(urlBase + "/two", String.class))
assertThat( .isEqualTo("two");
template.getForObject("http://localhost:" + port + "/two", String.class)) assertThat(template.getForObject(urlBase + "/three", String.class))
.isEqualTo("two"); .isEqualTo("three");
assertThat(template.getForObject("http://localhost:" + port + "/three",
String.class)).isEqualTo("three");
} }
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment