use of javax.ws.rs.core.Cookie in project jersey by jersey.
the class CookieParamAsPrimitiveTest method _testDefault.
void _testDefault(String base, String type, String value) throws ExecutionException, InterruptedException {
assertEquals("content", apply(RequestContextBuilder.from(base + "default/null", "GET").accept("application/" + type).build()).getEntity());
assertEquals("content", apply(RequestContextBuilder.from(base + "default", "GET").accept("application/" + type).build()).getEntity());
assertEquals("content", apply(RequestContextBuilder.from(base + "default/override", "GET").accept("application/" + type).cookie(new Cookie(type, value)).build()).getEntity());
}
use of javax.ws.rs.core.Cookie in project jersey by jersey.
the class CookieParamAsPrimitiveTest method testBadPrimitiveValue.
@Test
public void testBadPrimitiveValue() throws ExecutionException, InterruptedException {
final ContainerResponse responseContext = apply(RequestContextBuilder.from("/", "GET").accept("application/int").cookie(new Cookie("int", "abcdef")).build());
assertEquals(400, responseContext.getStatus());
}
use of javax.ws.rs.core.Cookie in project jersey by jersey.
the class CookieParamAsStringTest method testListGet.
@Test
public void testListGet() throws ExecutionException, InterruptedException {
initiateWebApplication(ResourceStringList.class);
_test("/", "application/list", new Cookie("args", "a"));
}
use of javax.ws.rs.core.Cookie in project jersey by jersey.
the class CookieParamAsStringTest method testStringGet.
@Test
public void testStringGet() throws ExecutionException, InterruptedException {
initiateWebApplication(ResourceString.class);
_test("/", new Cookie("arg1", "a"), new Cookie("arg2", "b"), new Cookie("arg3", "c"));
}
use of javax.ws.rs.core.Cookie in project jersey by jersey.
the class CookieParamAsStringTest method testStringListEmptyGet.
@Test
public void testStringListEmptyGet() throws ExecutionException, InterruptedException {
initiateWebApplication(ResourceStringListEmpty.class);
_test("/", "application/stringlist", new Cookie("args", ""));
}
Aggregations