diff --git a/spring-boot-modules/spring-boot-data/pom.xml b/spring-boot-modules/spring-boot-data/pom.xml index 5c76035a3a..b0dffa3f6d 100644 --- a/spring-boot-modules/spring-boot-data/pom.xml +++ b/spring-boot-modules/spring-boot-data/pom.xml @@ -157,6 +157,8 @@ + 3.2.2 + 5.10.2 2.2.4 19 com.baeldung.SpringBootDataApplication diff --git a/spring-boot-modules/spring-boot-data/src/main/resources/application.properties b/spring-boot-modules/spring-boot-data/src/main/resources/application.properties index cee5701cb5..7ad6ca058f 100644 --- a/spring-boot-modules/spring-boot-data/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-data/src/main/resources/application.properties @@ -6,5 +6,6 @@ spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.driver-class-name=org.h2.Driver spring.datasource.username=sa spring.datasource.password= +spring.main.allow-bean-definition-overriding=true diff --git a/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java index cb2aee8cdf..435b12b000 100644 --- a/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java +++ b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java @@ -44,7 +44,7 @@ public class ContactAppIntegrationTest { public void givenJsonFormatAnnotationAndJava8DateType_whenGet_thenReturnExpectedDateFormat() throws IOException, ParseException { ResponseEntity response = restTemplate.getForEntity("http://localhost:" + port + "/contacts", String.class); - assertEquals(200, response.getStatusCodeValue()); + assertEquals(200, response.getStatusCode().value()); List> respMap = mapper.readValue(response.getBody(), new TypeReference>>(){}); @@ -59,7 +59,7 @@ public class ContactAppIntegrationTest { public void givenJsonFormatAnnotationAndLegacyDateType_whenGet_thenReturnExpectedDateFormat() throws IOException { ResponseEntity response = restTemplate.getForEntity("http://localhost:" + port + "/contacts/javaUtilDate", String.class); - assertEquals(200, response.getStatusCodeValue()); + assertEquals(200, response.getStatusCode().value()); List> respMap = mapper.readValue(response.getBody(), new TypeReference>>(){}); @@ -74,7 +74,7 @@ public class ContactAppIntegrationTest { public void givenDefaultDateFormatInAppPropertiesAndLegacyDateType_whenGet_thenReturnExpectedDateFormat() throws IOException { ResponseEntity response = restTemplate.getForEntity("http://localhost:" + port + "/contacts/plainWithJavaUtilDate", String.class); - assertEquals(200, response.getStatusCodeValue()); + assertEquals(200, response.getStatusCode().value()); List> respMap = mapper.readValue(response.getBody(), new TypeReference>>(){}); @@ -89,7 +89,7 @@ public class ContactAppIntegrationTest { public void givenDefaultDateFormatInAppPropertiesAndJava8DateType_whenGet_thenNotApplyFormat() throws IOException { ResponseEntity response = restTemplate.getForEntity("http://localhost:" + port + "/contacts/plain", String.class); - assertEquals(200, response.getStatusCodeValue()); + assertEquals(200, response.getStatusCode().value()); List> respMap = mapper.readValue(response.getBody(), new TypeReference>>(){}); diff --git a/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java index c5c57c2973..dfe1ba3baf 100644 --- a/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java +++ b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java @@ -38,7 +38,7 @@ public class ContactAppWithObjectMapperCustomizerIntegrationTest { public void givenDefaultDateFormatInAppPropertiesAndLegacyDateType_whenGet_thenReturnExpectedDateFormat() throws IOException { ResponseEntity response = restTemplate.getForEntity("http://localhost:" + this.port + "/contacts/plainWithJavaUtilDate", String.class); - assertEquals(200, response.getStatusCodeValue()); + assertEquals(200, response.getStatusCode().value()); List> respMap = mapper.readValue(response.getBody(), new TypeReference>>(){}); @@ -53,7 +53,7 @@ public class ContactAppWithObjectMapperCustomizerIntegrationTest { public void givenDefaultDateFormatInAppPropertiesAndJava8DateType_whenGet_thenReturnExpectedDateFormat() throws IOException { ResponseEntity response = restTemplate.getForEntity("http://localhost:" + this.port + "/contacts/plain", String.class); - assertEquals(200, response.getStatusCodeValue()); + assertEquals(200, response.getStatusCode().value()); List> respMap = mapper.readValue(response.getBody(), new TypeReference>>(){});