use of org.zalando.nakadi.domain.EventTypeBase in project nakadi by zalando.
the class EventTypeTestBuilder method build.
public EventType build() {
final EventTypeBase eventTypeBase = new EventTypeBase(name, owningApplication, category, validationStrategies, enrichmentStrategies, partitionStrategy, partitionKeyFields, schema, defaultStatistic, options, compatibilityMode);
eventTypeBase.setAuthorization(authorization);
return new EventType(eventTypeBase, this.schema.getVersion().toString(), this.createdAt, this.updatedAt);
}
use of org.zalando.nakadi.domain.EventTypeBase in project nakadi by zalando.
the class SubscriptionAT method testSubscriptionWithManyEventTypesIsCreated.
@Test
public void testSubscriptionWithManyEventTypesIsCreated() throws IOException {
final List<String> eventTypes = IntStream.range(0, 10).mapToObj(i -> createEventType()).map(EventTypeBase::getName).collect(Collectors.toList());
final String subscription = "{\"owning_application\":\"app\",\"event_types\":" + "[" + eventTypes.stream().map(et -> "\"" + et + "\"").collect(Collectors.joining(",")) + "]}";
final Response response = given().body(subscription).contentType(JSON).post(SUBSCRIPTIONS_URL);
// assert response
response.then().statusCode(HttpStatus.SC_CREATED).contentType(JSON);
final Subscription gotSubscription = MAPPER.readValue(response.print(), Subscription.class);
Assert.assertNotNull(gotSubscription.getId());
}
Aggregations