Search in sources :

Example 1 with LocalLoginUnavailableException

use of nl.knaw.huygens.timbuctoo.security.exceptions.LocalLoginUnavailableException in project timbuctoo by HuygensING.

the class LoggedInUsersTest method throwsLocalLoginUnavailableExceptionWhenTheUserCouldNotBeAuthenticatedLocallyDueToASystemError.

@Test
public void throwsLocalLoginUnavailableExceptionWhenTheUserCouldNotBeAuthenticatedLocallyDueToASystemError() throws Exception {
    Authenticator authenticator = mock(JsonBasedAuthenticator.class);
    given(authenticator.authenticate(anyString(), anyString())).willThrow(new LocalLoginUnavailableException(""));
    LoggedInUsers instance = new LoggedInUsers(authenticator, null, ONE_SECOND_TIMEOUT, null);
    expectedException.expect(LocalLoginUnavailableException.class);
    instance.userTokenFor("", "");
}
Also used : LocalLoginUnavailableException(nl.knaw.huygens.timbuctoo.security.exceptions.LocalLoginUnavailableException) Test(org.junit.Test)

Aggregations

LocalLoginUnavailableException (nl.knaw.huygens.timbuctoo.security.exceptions.LocalLoginUnavailableException)1 Test (org.junit.Test)1