use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ResourceInfoTest method testInfoGetChild.
@Test
public void testInfoGetChild() throws ExecutionException, InterruptedException {
ApplicationHandler handler = getApplication();
final ContainerResponse response = handler.apply(RequestContextBuilder.from("/info/child", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("get-info-child", response.getEntity());
assertResponseHeaders(response, "ResourceTestingInfo", "getChildInfo");
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ResourceInfoTest method test404.
@Test
public void test404() throws ExecutionException, InterruptedException {
ApplicationHandler handler = getApplication();
final ContainerResponse response = handler.apply(RequestContextBuilder.from("/NOT_FOUND", "GET").build()).get();
assertEquals(404, response.getStatus());
assertResponseHeaders(response, "<null>", "<null>");
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ResourceInfoTest method testGetSubResource.
@Test
public void testGetSubResource() throws ExecutionException, InterruptedException {
ApplicationHandler handler = getApplication();
final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource/locator", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("get-sub-resource", response.getEntity());
assertResponseHeaders(response, "SubResource", "getFromSubResource");
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ResourceInfoTest method testGetMultiple.
@Test
public void testGetMultiple() throws ExecutionException, InterruptedException {
ApplicationHandler handler = getApplication();
ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("get", response.getEntity());
assertResponseHeaders(response, "MyResource", "get");
response = handler.apply(RequestContextBuilder.from("/resource/get-child", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("get-child", response.getEntity());
assertResponseHeaders(response, "MyResource", "getChild");
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ResourceInfoTest method testGetChild.
@Test
public void testGetChild() throws ExecutionException, InterruptedException {
ApplicationHandler handler = getApplication();
final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource/get-child", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("get-child", response.getEntity());
final String className = "MyResource";
final String methodName = "getChild";
assertResponseHeaders(response, className, methodName);
}
Aggregations