    @Test
    public void testLoginOk() throws Exception {

        when(userDetailsService.loadUserByUsername(TEST_USER)).thenReturn(USER_DETAILS);
        when(kerberosClient.login(TEST_USER, TEST_PASSWORD)).thenReturn(JAAS_SUBJECT_HOLDER);

        Authentication authenticate = provider.authenticate(INPUT_TOKEN);

        verify(kerberosClient).login(TEST_USER, TEST_PASSWORD);

        assertNotNull(authenticate);
        assertEquals(TEST_USER, authenticate.getName());
        assertEquals(USER_DETAILS, authenticate.getPrincipal());
        assertEquals(TEST_PASSWORD, authenticate.getCredentials());
        assertEquals(AUTHORITY_LIST, authenticate.getAuthorities());

    }