@Test
public void testShouldReadData() throws Exception {
boolean result;
DefaultHttpHeaders headers = new DefaultHttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM);
when(request.method()).thenReturn(HttpMethod.GET).thenReturn(HttpMethod.PUT);
when(request.headers()).thenReturn(new HeadersAdaptor(headers));
result = jerseyHandler.shouldReadData(request);
assertFalse(result);
result = jerseyHandler.shouldReadData(request);
assertFalse(result);
headers.clear();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN);
result = jerseyHandler.shouldReadData(request);
assertTrue(result);
headers.clear();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
result = jerseyHandler.shouldReadData(request);
assertTrue(result);
headers.clear();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
when(request.method()).thenReturn(HttpMethod.POST);
result = jerseyHandler.shouldReadData(request);
assertTrue(result);
headers.clear();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML);
result = jerseyHandler.shouldReadData(request);
assertTrue(result);
headers.clear();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED + "; charset=UTF-8");
result = jerseyHandler.shouldReadData(request);
assertTrue(result);
}