@Test
public void processesRequest() throws Exception {

    ContainerRequest containerRequest = mockContainerRequest();
    ContainerResponse containerResponse = mockContainerResponse();
    EnvironmentContext environmentContext = mock(EnvironmentContext.class);
    doAnswer(invocation -> {
        Response response = mock(Response.class);
        when(response.getStatus()).thenReturn(200);
        when(response.getEntity()).thenReturn("foo");
        containerResponse.setResponse(response);
        return null;
    }).when(requestHandler).handleRequest(containerRequest, containerResponse);
    everrestProcessor.process(containerRequest, containerResponse, environmentContext);
    ArgumentCaptor<Response> argumentCaptor = ArgumentCaptor.forClass(Response.class);
    verify(containerResponse).setResponse(argumentCaptor.capture());
    assertEquals(200, argumentCaptor.getValue().getStatus());
    assertEquals("foo", argumentCaptor.getValue().getEntity());
}