@Test public void testLogout() throws Exception { SecurityContextHolder.getContext().setAuthentication(this.auth); this.module.login(); assertThat(this.module.logout()).as("Should return true as it succeeds").isTrue(); assertThat(this.module.getAuthentication()).as("Authentication should be null") .isNull(); assertThat(this.subject.getPrincipals().contains(this.auth)) .withFailMessage( "Principals should not contain the authentication after logout") .isFalse(); }