Search in sources :

Example 1 with UnknownTokenException

use of org.molgenis.security.core.token.UnknownTokenException in project molgenis by molgenis.

the class TokenAuthenticationProviderTest method authenticateInvalidToken.

@Test(expectedExceptions = AuthenticationException.class)
public void authenticateInvalidToken() {
    when(tokenService.findUserByToken("token")).thenThrow(new UnknownTokenException("Invalid token"));
    tokenAuthenticationProvider.authenticate(new RestAuthenticationToken("token"));
}
Also used : UnknownTokenException(org.molgenis.security.core.token.UnknownTokenException) Test(org.testng.annotations.Test)

Aggregations

UnknownTokenException (org.molgenis.security.core.token.UnknownTokenException)1 Test (org.testng.annotations.Test)1