Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Complete
-
5.0 GA, 5.0.3
-
true
Description
I have a Spring Project 4.3.10.RELEASE, MVC and Rest are tested (working with JUnit 4).
In some scenarios the Accept-Language header is applied. Until here all work fine.
I have created other project working with Spring Project 5.0.3.RELEASE, practically the same infrastructure is used, but all the Test classes have migrated to JUnit 5. Remember the business and infrastructure code remains the same.
When I test MVC it fails with the following error message:
Error Message range=en_us Stacktrace java.lang.IllegalArgumentException: range=en_us at java.util.Locale$LanguageRange.<init>(Locale.java:2913) at sun.util.locale.LocaleMatcher.parse(LocaleMatcher.java:284) at java.util.Locale$LanguageRange.parse(Locale.java:3028) at org.springframework.http.HttpHeaders.getAcceptLanguage(HttpHeaders.java:479) at org.springframework.http.HttpHeaders.getAcceptLanguageAsLocales(HttpHeaders.java:499) at org.springframework.mock.web.MockHttpServletRequest.addHeader(MockHttpServletRequest.java:996) at org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder.buildRequest(MockHttpServletRequestBuilder.java:624) at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:141) at com.manuel.jordan.controller.persona.AbstractPersonaDeleteOneControllerTest.deleteOneDeleteTest(AbstractPersonaDeleteOneControllerTest.java:112) at com.manuel.jordan.controller
What is strange is range=en_us , the Locale is created in this way within an enum new Locale("en","US").
The Rest Test classes fails with:
Error Message 500 Internal Server Error Stacktrace org.springframework.web.client.HttpServerErrorException: 500 Internal Server Error at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:97) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:79) at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:773) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:726) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:700) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:670) at
Sadly the error message is not useful
Note I get the same error messages if for the first project I create a new branch through Git and use Spring updated to 5.0.3.RELEASE.
Thus not sure if it is bug or something extra about configuration is mandatory now. I am confused
Thanks