use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ChildResourceTest method testAnotherChildResource.
@Test
public void testAnotherChildResource() throws ExecutionException, InterruptedException {
ApplicationHandler applicationHandler = createApplication();
final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/root/another-child", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("another-child-get", response.getEntity());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ResourceNotFoundTest method testExistingMixedResources.
@Test
public void testExistingMixedResources() throws Exception {
ApplicationHandler app = createMixedApp();
ContainerResponse response;
response = app.apply(RequestContextBuilder.from("/foo", "GET").accept("text/plain").build()).get();
assertEquals(200, response.getStatus());
assertEquals("foo", response.getEntity());
response = app.apply(RequestContextBuilder.from("/dynamic", "GET").accept("text/plain").build()).get();
assertEquals(200, response.getStatus());
assertEquals("dynamic", response.getEntity());
response = app.apply(RequestContextBuilder.from("/foo/bar", "GET").accept("text/plain").build()).get();
assertEquals(200, response.getStatus());
assertEquals("bar", response.getEntity());
response = app.apply(RequestContextBuilder.from("/foo/dynamic", "GET").accept("text/plain").build()).get();
assertEquals(200, response.getStatus());
assertEquals("dynamic", response.getEntity());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class SubResourceDynamicTest method testSubResourceDynamic.
@Test
public void testSubResourceDynamic() throws Exception {
app = createApplication(Parent.class);
ContainerResponse response;
response = app.apply(RequestContextBuilder.from("/parent", "GET").accept("text/plain").build()).get();
assertEquals("parent", response.getEntity());
response = app.apply(RequestContextBuilder.from("/parent/child", "GET").accept("text/plain").build()).get();
assertEquals("child", response.getEntity());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ExtendedUriInfoTest method testResourceMethod.
@Test
public void testResourceMethod() throws ExecutionException, InterruptedException {
final ApplicationHandler applicationHandler = getApplication();
final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/root", "GET").build()).get();
assertEquals("root", response.getEntity());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class ExtendedUriInfoTest method testChildResourceMethod.
@Test
public void testChildResourceMethod() throws ExecutionException, InterruptedException {
final ApplicationHandler applicationHandler = getApplication();
final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/root/child", "GET").build()).get();
assertEquals("child", response.getEntity());
}
Aggregations