### Question:
RequestPreprocessor { public String preprocess(Message m, UriInfo u) { handleExtensionMappings(m, u); handleLanguageMappings(m, u); MultivaluedMap<String, String> queries = u.getQueryParameters(); handleTypeQuery(m, queries); handleCType(m, queries); handleMethod(m, queries, new HttpHeadersImpl(m)); return new UriInfoImpl(m, null).getPath(); } RequestPreprocessor();  RequestPreprocessor(Map<Object, Object> languageMappings,
                           Map<Object, Object> extensionMappings); String preprocess(Message m, UriInfo u);  }### Answer:
@Test public void testMethodQuery() { Message m = mockMessage("http: RequestPreprocessor sqh = new RequestPreprocessor(); sqh.preprocess(m, new UriInfoImpl(m, null)); assertEquals("POST", m.get(Message.HTTP_REQUEST_METHOD)); m.put("org.apache.cxf.jaxrs.allow.http.method.override", true); sqh.preprocess(m, new UriInfoImpl(m, null)); assertEquals("GET", m.get(Message.HTTP_REQUEST_METHOD)); }
@Test public void testMethodOverride() { Message m = mockMessage("http: RequestPreprocessor sqh = new RequestPreprocessor(); sqh.preprocess(m, new UriInfoImpl(m, null)); assertEquals("POST", m.get(Message.HTTP_REQUEST_METHOD)); m.put("org.apache.cxf.jaxrs.allow.http.method.override", true); sqh.preprocess(m, new UriInfoImpl(m, null)); assertEquals("GET", m.get(Message.HTTP_REQUEST_METHOD)); }
@Test public void testTypeQuery() { Message m = mockMessage("http: RequestPreprocessor sqh = new RequestPreprocessor(); sqh.preprocess(m, new UriInfoImpl(m, null)); assertEquals("POST", m.get(Message.HTTP_REQUEST_METHOD)); assertEquals("application/xml", m.get(Message.ACCEPT_CONTENT_TYPE)); }