MediaType.valueOf("*/*;q=0.8")
);
String param1 = URLEncoder.encode("application/xml;q=0.9,application/xhtml+xml,*/*;q=0.8", "UTF-8");
String param2 = URLEncoder.encode("text/html", "UTF-8");
HttpRequest request = MockHttpRequest.get(
"foo?" + acceptParamName + "=" + param1 + "&" +
acceptParamName + "=" + param2);
PreMatchContainerRequestContext context = new PreMatchContainerRequestContext(request);
processor.filter(context);
List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();
Assert.assertEquals("Incorrect acceptable media type extracted", expected, actual);
}