Пример #1
0
 @Test
 public void testCookieAttributes_whenCookieSomeAttributesAndDoesNotHaveSome() throws Exception {
   when(request.getCookies()).thenReturn(cookies);
   when(cookies[0].getName()).thenReturn("validkey1");
   when(cookies[0].getValue()).thenReturn("validvalue1");
   assertThat(
       Traceables.cookieAttrs(request, "validkey1", "invalidkey1").asString(),
       is(equalTo("Cookie[].attrs: [[{validkey1=validvalue1}]]")));
 }
Пример #2
0
 @Test
 public void testCookieAttributes_whenRequestIsNull() throws Exception {
   assertThat(
       Traceables.cookieAttrs(null, "validkey1").asString(),
       is(equalTo("[Unable to retrieve Cookie[] - null HttpServletRequest]")));
 }
Пример #3
0
 @Test
 public void testCookieAttributes_whenCookieIsNull() throws Exception {
   when(request.getCookies()).thenReturn(null);
   assertThat(
       Traceables.cookieAttrs(request, "validkey1").asString(), is(equalTo("[null - Cookie[]]")));
 }