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());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class PathParamDefaultValueTest method testDefaultPathParamValueOnResource2.
@Test
public void testDefaultPathParamValueOnResource2() throws ExecutionException, InterruptedException {
initiateWebApplication(Resource.class);
ContainerResponse response = getResponseContext("/foo/bar/aaa");
assertEquals("aaa", response.getEntity());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class QueryParamAsPrimitiveTest method testBadPrimitiveValue.
@Test
public void testBadPrimitiveValue() throws ExecutionException, InterruptedException {
final ContainerResponse response = super.getResponseContext("/?int=abcdef", "application/int");
assertEquals(404, response.getStatus());
}
Aggregations