Search in sources :

Example 6 with PaginationLinks

use of org.zalando.nakadi.domain.PaginationLinks in project nakadi by zalando.

the class SubscriptionAT method testListSubscriptions.

@Test
public void testListSubscriptions() throws IOException {
    final String etName = createEventType().getName();
    final String filterApp = randomUUID();
    final Subscription sub1 = createSubscription(RandomSubscriptionBuilder.builder().withEventType(etName).withOwningApplication(filterApp).buildSubscriptionBase());
    final Subscription sub2 = createSubscription(RandomSubscriptionBuilder.builder().withEventType(etName).withOwningApplication(filterApp).buildSubscriptionBase());
    createSubscription(RandomSubscriptionBuilder.builder().withEventType(etName).buildSubscriptionBase());
    final PaginationWrapper expectedList = new PaginationWrapper(ImmutableList.of(sub2, sub1), new PaginationLinks());
    given().param("owning_application", filterApp).get("/subscriptions").then().statusCode(HttpStatus.SC_OK).body(JSON_HELPER.matchesObject(expectedList));
}
Also used : PaginationLinks(org.zalando.nakadi.domain.PaginationLinks) Matchers.isEmptyString(org.hamcrest.Matchers.isEmptyString) Subscription(org.zalando.nakadi.domain.Subscription) NakadiTestUtils.createSubscription(org.zalando.nakadi.webservice.utils.NakadiTestUtils.createSubscription) PaginationWrapper(org.zalando.nakadi.domain.PaginationWrapper) Test(org.junit.Test)

Aggregations

PaginationLinks (org.zalando.nakadi.domain.PaginationLinks)6 PaginationWrapper (org.zalando.nakadi.domain.PaginationWrapper)5 Subscription (org.zalando.nakadi.domain.Subscription)5 Test (org.junit.Test)4 List (java.util.List)1 Matchers.isEmptyString (org.hamcrest.Matchers.isEmptyString)1 ServiceUnavailableException (org.zalando.nakadi.exceptions.ServiceUnavailableException)1 NakadiTestUtils.createSubscription (org.zalando.nakadi.webservice.utils.NakadiTestUtils.createSubscription)1 Problem (org.zalando.problem.Problem)1