    @Test
    public void logout() throws LoginException {

        when(userDao.getByUsername(eq(TEST_USERNAME))).thenReturn(testUser);
        PLCLoginModule testLoginModule = invokeLogin(TEST_USERNAME, TEST_PASSWORD);
        assertTrue(subject.getPrincipals().contains(new UserRole("plcuser")));
        assertTrue(subject.getPrincipals().contains(new UserPrincipal(testUser)));
        testLoginModule.logout();
        assertFalse(subject.getPrincipals().contains(new UserRole("plcuser")));
        assertFalse(subject.getPrincipals().contains(new UserPrincipal(testUser)));
    }