### Question:
TokenGenerator { @Deprecated public void setTokenToResponseCookie(HttpServletRequest request, HttpServletResponse res, Object apiTokenFromClient) { PortalCookies portalCookies = new PortalCookies(); portalCookies.addCSRFTokenCookieToResponse(request, res, apiTokenFromClient); }  @Deprecated void setTokenToResponseCookie(HttpServletRequest request, HttpServletResponse res, Object apiTokenFromClient); String createOrLoadToken(final HttpSession session); void setTokenToResponseHeader(final HttpServletResponse res, final String token); static final String API_TOKEN; static final String X_BONITA_API_TOKEN; }### Answer:
@Test public void testSetTokenToResponseCookie() throws Exception { portalCookies.addCSRFTokenCookieToResponse(request, response, BONITA_TOKEN_VALUE); final Cookie csrfCookie = response.getCookie(BONITA_TOKEN_NAME); assertThat(csrfCookie.getName()).isEqualTo(BONITA_TOKEN_NAME); assertThat(csrfCookie.getPath()).isEqualTo(CONTEXT_PATH); assertThat(csrfCookie.getValue()).isEqualTo(BONITA_TOKEN_VALUE); assertThat(csrfCookie.getSecure()).isFalse(); }