}
@Test
public void testResponse() throws Exception {
JaxRsHandler handler = HandlerCreator.getHandler(MyResource.class);
Request requestMock = EasyMock.createNiceMock(Request.class);
ResponseImpl responseImpl = new ResponseImpl();
expect(requestMock.getMethod()).andReturn(Method.GET).anyTimes();
headerNames.add(HeaderName.ACCEPT);
expect(requestMock.getHeaderNames()).andReturn(headerNames);
expect(requestMock.getHeaderValues(HeaderName.ACCEPT)).andReturn(accept);
RequestURI requestURI = EasyMock.createNiceMock(RequestURI.class);
expect(requestURI.getPath()).andReturn("/foo").anyTimes();
expect(requestMock.getRequestURI()).andReturn(requestURI).anyTimes();
//responseMock.addHeader(HeaderName.CONTENT_TYPE, MediaType.valueOf("text/plain;q=.8"));
replay(requestMock);
replay(requestURI);
handler.handle(requestMock, responseImpl);
responseImpl.consumeBody();
String[] contentType = responseImpl.getHeaders().get(HeaderName.CONTENT_TYPE);
Assert.assertTrue(contentType.length == 1);
Assert.assertEquals("text/plain", contentType[0]);
}