use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class QueryParamAsSortedSetPrimitiveTest method testBadPrimitiveSortedSetValue.
@Test
public void testBadPrimitiveSortedSetValue() throws ExecutionException, InterruptedException {
final ContainerResponse response = super.getResponseContext("/SortedSet?int=abcdef&int=abcdef", "application/int");
assertEquals(404, response.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class QueryParamAsStringTest method testStringPost.
@Test
public void testStringPost() throws ExecutionException, InterruptedException {
initiateWebApplication(ResourceString.class);
final ContainerResponse responseContext = apply(RequestContextBuilder.from("/?arg1=a&arg2=b&arg3=c", "POST").entity("content").build());
assertEquals("content", responseContext.getEntity());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class HeaderParamStringConstructorTest method testBadStringConstructorValue.
@Test
public void testBadStringConstructorValue() throws ExecutionException, InterruptedException {
initiateWebApplication(ResourceString.class);
final ContainerResponse responseContext = apply(RequestContextBuilder.from("/", "GET").header("arg1", "ABCDEF").header("arg2", "3145").header("arg3", "http://test").build());
assertEquals(400, responseContext.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class InvalidParamsTest method testInvalidPathParam.
@Test
public void testInvalidPathParam() throws Exception {
ContainerResponse responseContext = createApplication(ResourceInvalidParams.class).apply(RequestContextBuilder.from("/invalid/path/param", "GET").build()).get();
// returned param is null -> 204 NO CONTENT
assertEquals(204, responseContext.getStatus());
}
use of org.glassfish.jersey.server.ContainerResponse in project jersey by jersey.
the class MatrixParamAsPrimitiveTest method testBadPrimitiveListValue.
@Test
public void testBadPrimitiveListValue() throws ExecutionException, InterruptedException {
final ContainerResponse responseContext = apply(RequestContextBuilder.from("/list;int=abcdef;int=abcdef", "GET").accept("application/int").build());
assertEquals(404, responseContext.getStatus());
}
Aggregations