use of org.zalando.nakadi.exceptions.runtime.TooManyPartitionsException in project nakadi by zalando.
the class PostSubscriptionControllerTest method whenMoreThanAllowedEventTypeThenUnprocessableEntity.
@Test
public void whenMoreThanAllowedEventTypeThenUnprocessableEntity() throws Exception {
when(subscriptionService.getExistingSubscription(any())).thenThrow(new NoSubscriptionException("", null));
when(subscriptionService.createSubscription(any())).thenThrow(new TooManyPartitionsException("msg"));
final SubscriptionBase subscriptionBase = builder().buildSubscriptionBase();
final Problem expectedProblem = Problem.valueOf(UNPROCESSABLE_ENTITY, "msg");
checkForProblem(postSubscription(subscriptionBase), expectedProblem);
}
Aggregations