use of org.springframework.security.web.savedrequest.SavedCookie in project spring-security by spring-projects.
the class DefaultSavedRequestMixinTests method serializeDefaultRequestBuildWithBuilderTest.
@Test
public void serializeDefaultRequestBuildWithBuilderTest() throws IOException, JSONException {
DefaultSavedRequest request = new DefaultSavedRequest.Builder().setCookies(Collections.singletonList(new SavedCookie(new Cookie("SESSION", "123456789")))).setHeaders(Collections.singletonMap("x-auth-token", Collections.singletonList("12"))).setScheme("http").setRequestURL("http://localhost").setServerName("localhost").setRequestURI("").setLocales(Collections.singletonList(new Locale("en"))).setContextPath("").setMethod("").setServletPath("").build();
String actualString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(request);
JSONAssert.assertEquals(REQUEST_JSON, actualString, true);
}
use of org.springframework.security.web.savedrequest.SavedCookie in project spring-security by spring-projects.
the class SavedCookieTests method setUp.
@Before
public void setUp() throws Exception {
cookie = new Cookie("name", "value");
cookie.setComment("comment");
cookie.setDomain("domain");
cookie.setMaxAge(100);
cookie.setPath("path");
cookie.setSecure(true);
cookie.setVersion(11);
savedCookie = new SavedCookie(cookie);
}
Aggregations