### Question:
SuccessfulLoginHandler implements AuthenticationSuccessHandler { @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { TokenAuthentication tokenAuthentication = (TokenAuthentication) authentication; String token = tokenAuthentication.getCredentials(); setCookie(token, response); response.setStatus(HttpStatus.NO_CONTENT.value()); }  @Override void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication);  }### Answer:
@Test public void testOnAuthenticationSuccess() { successfulLoginHandler.onAuthenticationSuccess( httpServletRequest, httpServletResponse, new TokenAuthentication("TEST_TOKEN_STRING") ); assertEquals(HttpStatus.NO_CONTENT.value(), httpServletResponse.getStatus()); assertNotNull(httpServletResponse.getCookie(authConfigurationProperties.getCookieProperties().getCookieName())); }