use of org.zalando.nakadi.plugin.api.PluginException in project nakadi by zalando.
the class AuthorizationValidatorTest method whenPluginExceptionInIsAuthorizationAttributeValidThenServiceUnavailableException.
@Test(expected = ServiceTemporarilyUnavailableException.class)
public void whenPluginExceptionInIsAuthorizationAttributeValidThenServiceUnavailableException() throws Exception {
final ResourceAuthorization auth = new ResourceAuthorization(ImmutableList.of(attr1), ImmutableList.of(attr2), ImmutableList.of(attr3));
when(authorizationService.isAuthorizationAttributeValid(any())).thenThrow(new PluginException("blah"));
validator.validateAuthorization(auth);
}
use of org.zalando.nakadi.plugin.api.PluginException in project nakadi by zalando.
the class AuthorizationValidatorTest method whenPluginExceptionInAuthorizeEventTypeUpdateThenServiceTemporaryUnavailableException.
@Test(expected = ServiceTemporarilyUnavailableException.class)
public void whenPluginExceptionInAuthorizeEventTypeUpdateThenServiceTemporaryUnavailableException() throws Exception {
when(authorizationService.isAuthorized(any(), any())).thenThrow(new PluginException("blah"));
validator.authorizeEventTypeAdmin(EventTypeTestBuilder.builder().authorization(new ResourceAuthorization(null, null, null)).build());
}
Aggregations