SimpleTokenManager implements TokenManager { @Override public NewCookie createSecureTokenNewCookie(SignedJWT token) { return new NewCookie(TOKEN_NAME, token.serialize(), "/", null, null, (int) (tokenDuration / 1000), true); }  @Activate void start(Map<String, Object> props); @Modified void modified(Map<String, Object> props); @Override Optional<SignedJWT> verifyToken(String tokenString); @Override SignedJWT generateUnauthToken(); @Override SignedJWT generateAuthToken(String username); @Override String getTokenString(ContainerRequestContext requestContext); @Override String getTokenString(HttpServletRequest servletRequest); @Override Cookie createSecureTokenCookie(SignedJWT token); @Override NewCookie createSecureTokenNewCookie(SignedJWT token);  }
@Test public void createSecureTokenNewCookieTest() { NewCookie result = manager.createSecureTokenNewCookie(jwt); assertEquals(SimpleTokenManager.TOKEN_NAME, result.getName()); assertEquals(MOBI_TOKEN, result.getValue()); assertTrue(result.isSecure()); assertEquals("/", result.getPath()); }