@ -987,6 +987,20 @@ public class ServletAnnotationControllerTests {
@@ -987,6 +987,20 @@ public class ServletAnnotationControllerTests {
assertEquals ( 406 , response . getStatus ( ) ) ;
}
@Test
public void responseBodyWildCardMediaType ( ) throws ServletException , IOException {
initServlet ( RequestBodyController . class ) ;
MockHttpServletRequest request = new MockHttpServletRequest ( "PUT" , "/something" ) ;
String requestBody = "Hello World" ;
request . setContent ( requestBody . getBytes ( "UTF-8" ) ) ;
request . addHeader ( "Content-Type" , "text/plain; charset=utf-8" ) ;
request . addHeader ( "Accept" , "*/*" ) ;
MockHttpServletResponse response = new MockHttpServletResponse ( ) ;
servlet . service ( request , response ) ;
assertEquals ( requestBody , response . getContentAsString ( ) ) ;
}
@Test
public void unsupportedRequestBody ( ) throws ServletException , IOException {
initServlet ( RequestBodyController . class ) ;