Search in sources :

Example 1 with InMemoryTestContainerFactory

use of org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory in project jersey by jersey.

the class ResponseWriterMetadataTest method testResponse.

@Test
public void testResponse() {
    final Response response = target().request().get();
    assertThat(response.readEntity(String.class), is("one"));
    assertThat(response.getHeaderString("X-BEFORE-WRITE"), is("foo"));
    if (factory instanceof InMemoryTestContainerFactory) {
        assertThat(response.getHeaderString("X-AFTER-WRITE"), is("bar"));
    } else {
        assertThat(response.getHeaderString("X-AFTER-WRITE"), nullValue());
    }
}
Also used : Response(javax.ws.rs.core.Response) InMemoryTestContainerFactory(org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory) Test(org.junit.Test)

Aggregations

Response (javax.ws.rs.core.Response)1 InMemoryTestContainerFactory (org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory)1 Test (org.junit.Test)1