use of com.yahoo.vespa.hosted.controller.api.integration.athenz.ZmsKeystore in project vespa by vespa-engine.
the class NTokenValidatorTest method failing_to_find_key_should_throw_exception.
@Test
public void failing_to_find_key_should_throw_exception() throws InvalidTokenException {
ZmsKeystore keystore = (athensService, keyId) -> {
throw new RuntimeException();
};
NTokenValidator validator = new NTokenValidator(keystore);
NToken token = createNToken(IDENTITY, Instant.now(), TRUSTED_KEY.getPrivate(), "0");
exceptionRule.expect(InvalidTokenException.class);
exceptionRule.expectMessage("Failed to retrieve public key");
validator.validate(token);
}
Aggregations