From 1ad0bfaf298178e1ac3f46ecde3afc94512dc972 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Wed, 19 Feb 2020 22:34:10 +0100 Subject: [PATCH] BAEL-3804: Update spring-mvc-java to use latest Spring Boot version (#8747) --- spring-mvc-java/pom.xml | 2 -- .../config/CustomWebMvcConfigurationSupport.java | 14 +++++++------- .../controller/GreetControllerIntegrationTest.java | 2 +- .../web/controller/GreetControllerUnitTest.java | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/spring-mvc-java/pom.xml b/spring-mvc-java/pom.xml index 0f3a1d65b9..079a664a5d 100644 --- a/spring-mvc-java/pom.xml +++ b/spring-mvc-java/pom.xml @@ -223,8 +223,6 @@ - 2.1.9.RELEASE - 3.0.9.RELEASE diff --git a/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java b/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java index 4a9f6a3431..a0dd7358d0 100644 --- a/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java +++ b/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java @@ -1,17 +1,17 @@ package com.baeldung.spring.web.config; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; @Configuration public class CustomWebMvcConfigurationSupport extends WebMvcConfigurationSupport { - @Bean - public RequestMappingHandlerMapping requestMappingHandlerMapping() { - RequestMappingHandlerMapping handlerMapping = super.requestMappingHandlerMapping(); - handlerMapping.setUseSuffixPatternMatch(false); - return handlerMapping; + @Override + protected PathMatchConfigurer getPathMatchConfigurer() { + PathMatchConfigurer pathMatchConfigurer = super.getPathMatchConfigurer(); + pathMatchConfigurer.setUseSuffixPatternMatch(false); + + return pathMatchConfigurer; } } diff --git a/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerIntegrationTest.java b/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerIntegrationTest.java index 079ea3e5cd..3d34a46791 100644 --- a/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerIntegrationTest.java +++ b/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerIntegrationTest.java @@ -32,7 +32,7 @@ public class GreetControllerIntegrationTest { private MockMvc mockMvc; - private static final String CONTENT_TYPE = "application/json;charset=UTF-8"; + private static final String CONTENT_TYPE = "application/json"; @Before public void setup() throws Exception { diff --git a/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerUnitTest.java b/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerUnitTest.java index 0475bd933d..eacd256438 100644 --- a/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerUnitTest.java +++ b/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerUnitTest.java @@ -16,7 +16,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; public class GreetControllerUnitTest { private MockMvc mockMvc; - private static final String CONTENT_TYPE = "application/json;charset=UTF-8"; + private static final String CONTENT_TYPE = "application/json"; @Before public void setup() {