String type = MediaType.TEXT_XML;
HttpRequest request = MockHttpRequest.get("foo?" + acceptParamName + "=" + type);
MediaType mediaType = MediaType.valueOf(type);
processor.preProcess(request);
List<MediaType> list = request.getHttpHeaders().getAcceptableMediaTypes();
Assert.assertEquals("Incorrect acceptable list size", 1, list.size());
Assert.assertEquals("Incorrect media type extracted", mediaType, list.get(0));