use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class EntityTypeFilterTest method test.
@Test
public void test() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(Resource.class, ResponseFilter.class));
final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource/getentitytype", "GET").build()).get();
assertEquals(200, response.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class FilterSetMethodTest method testResource.
@Test
public void testResource() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(Resource.class, PostMatchFilter.class));
ContainerResponse res = handler.apply(RequestContextBuilder.from("", "/resource/setMethodInResource", "GET").build()).get();
assertEquals(200, res.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class FilterSetMethodTest method testPreMatchingFilter.
@Test
public void testPreMatchingFilter() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(Resource.class, PreMatchFilter.class));
ContainerResponse res = handler.apply(RequestContextBuilder.from("", "/resource/setMethod", "GET").build()).get();
assertEquals(200, res.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class PathParamDefaultValueTest method testCallWithMissingPathParam404.
@Test
public void testCallWithMissingPathParam404() throws ExecutionException, InterruptedException {
initiateWebApplication(Resource.class);
ContainerResponse response = getResponseContext("/foo/bar");
assertEquals(404, response.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class PathParamDefaultValueTest method testDefaultPathParamValueFoo.
@Test
public void testDefaultPathParamValueFoo() throws ExecutionException, InterruptedException {
initiateWebApplication(FooResource.class);
ContainerResponse response = getResponseContext("/foo");
assertEquals("default-id", response.getEntity());
}
Aggregations