Search in sources :

Example 41 with Cookie

use of javax.ws.rs.core.Cookie in project jersey by jersey.

the class CookieParamAsStringTest method testStringListGet.

@Test
public void testStringListGet() throws ExecutionException, InterruptedException {
    initiateWebApplication(ResourceStringList.class);
    _test("/", "application/stringlist", new Cookie("args", "a"));
}
Also used : Cookie(javax.ws.rs.core.Cookie) Test(org.junit.Test)

Example 42 with Cookie

use of javax.ws.rs.core.Cookie in project jersey by jersey.

the class CookieParamAsStringTest method testStringDefaultOverride.

@Test
public void testStringDefaultOverride() throws ExecutionException, InterruptedException {
    initiateWebApplication(ResourceStringDefaultOverride.class);
    _test("/", new Cookie("arg1", "d"), new Cookie("arg2", "e"), new Cookie("arg3", "f"));
}
Also used : Cookie(javax.ws.rs.core.Cookie) Test(org.junit.Test)

Example 43 with Cookie

use of javax.ws.rs.core.Cookie in project jersey by jersey.

the class CookieParamStringConstructorTest method testStringConstructorGet.

@Test
public void testStringConstructorGet() throws ExecutionException, InterruptedException {
    initiateWebApplication(ResourceString.class);
    _test("/", new Cookie("arg1", "3.145"), new Cookie("arg2", "3145"), new Cookie("arg3", "http://test"));
}
Also used : Cookie(javax.ws.rs.core.Cookie) Test(org.junit.Test)

Example 44 with Cookie

use of javax.ws.rs.core.Cookie in project jersey by jersey.

the class CookieParamStringConstructorTest method testStringConstructorListEmptyGet.

@Test
public void testStringConstructorListEmptyGet() throws ExecutionException, InterruptedException {
    initiateWebApplication(ResourceStringListEmpty.class);
    _test("/", "application/stringlist", new Cookie("args", ""));
}
Also used : Cookie(javax.ws.rs.core.Cookie) Test(org.junit.Test)

Example 45 with Cookie

use of javax.ws.rs.core.Cookie in project jersey by jersey.

the class CookieParamStringConstructorTest method testBadStringConstructorValue.

@Test
public void testBadStringConstructorValue() throws ExecutionException, InterruptedException {
    initiateWebApplication(ResourceString.class);
    final ContainerResponse responseContext = apply(RequestContextBuilder.from("/", "GET").cookie(new Cookie("arg1", "ABCDEF")).cookie(new Cookie("arg2", "3145")).cookie(new Cookie("arg3", "http://test")).build());
    assertEquals(400, responseContext.getStatus());
}
Also used : Cookie(javax.ws.rs.core.Cookie) ContainerResponse(org.glassfish.jersey.server.ContainerResponse) Test(org.junit.Test)

Aggregations

Cookie (javax.ws.rs.core.Cookie)80 Test (org.junit.Test)40 Response (javax.ws.rs.core.Response)18 HashMap (java.util.HashMap)12 WebTarget (javax.ws.rs.client.WebTarget)12 HttpServletResponse (javax.servlet.http.HttpServletResponse)10 MultivaluedMap (javax.ws.rs.core.MultivaluedMap)8 NewCookie (javax.ws.rs.core.NewCookie)7 ContainerResponse (org.glassfish.jersey.server.ContainerResponse)7 Map (java.util.Map)5 Message (org.apache.cxf.message.Message)5 Entitlement (com.sun.identity.entitlement.Entitlement)4 EntitlementSubject (com.sun.identity.entitlement.EntitlementSubject)4 Privilege (com.sun.identity.entitlement.Privilege)4 PrivilegeManager (com.sun.identity.entitlement.PrivilegeManager)4 ClientResponse (com.sun.jersey.api.client.ClientResponse)4 HttpHeaders (javax.ws.rs.core.HttpHeaders)4 MultivaluedHashMap (javax.ws.rs.core.MultivaluedHashMap)4 BeforeClass (org.testng.annotations.BeforeClass)4 SSOToken (com.iplanet.sso.SSOToken)3