@Test
public void testShouldApplyTrue() throws JOSEException {

  JwtAuthenticationProperties properties = createTestProperties();
  JwtAuthenticationFilter filter = new JwtAuthenticationFilter(properties, null, null);
  SignedJWT token = getInvalidToken();
  Cookie cookie = createMock(Cookie.class);
  expect(cookie.getName()).andReturn("non-default").atLeastOnce();
  expect(cookie.getValue()).andReturn(token.serialize()).atLeastOnce();
  HttpServletRequest request = createMock(HttpServletRequest.class);
  expect(request.getCookies()).andReturn(new Cookie[]{cookie});
  replay(request, cookie);
  Assert.assertTrue(filter.shouldApply(request));
  verify(request, cookie);
}