RepositoryLogoutHandler implements LogoutHandler { @Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { if (authentication != null) { repository.logoutUser(authentication.getName()); logger.info("#RepositoryLogoutHandler: GemFireAuthentication JMX Connection Closed."); } } RepositoryLogoutHandler(Repository repository); @Override void logout(HttpServletRequest request, HttpServletResponse response,
      Authentication authentication);  }
@Test public void logsOutAuthenticatedUser() { String authenticatedUser = "authenticated-user"; Authentication authentication = mock(Authentication.class); when(authentication.getName()).thenReturn(authenticatedUser); handler.logout(null, null, authentication); verify(repository, times(1)).logoutUser(authenticatedUser); }