use of org.zalando.nakadi.validation.JsonSchemaEnrichment in project nakadi by zalando.
the class EventTypeCacheTest method initValidation.
@BeforeClass
public static void initValidation() {
ValidationStrategy.register(EventBodyMustRespectSchema.NAME, new EventBodyMustRespectSchema(new JsonSchemaEnrichment()));
ValidationStrategy.register(EventMetadataValidationStrategy.NAME, new EventMetadataValidationStrategy());
}
use of org.zalando.nakadi.validation.JsonSchemaEnrichment in project nakadi by zalando.
the class RepositoriesConfig method eventTypeCache.
@Bean
public EventTypeCache eventTypeCache(final ZooKeeperHolder zooKeeperHolder, @DB final EventTypeRepository eventTypeRepository, @DB final TimelineDbRepository timelineRepository, final TimelineSync timelineSync) {
ValidationStrategy.register(EventBodyMustRespectSchema.NAME, new EventBodyMustRespectSchema(new JsonSchemaEnrichment()));
ValidationStrategy.register(EventMetadataValidationStrategy.NAME, new EventMetadataValidationStrategy());
try {
return new EventTypeCache(eventTypeRepository, timelineRepository, zooKeeperHolder, timelineSync);
} catch (final Exception e) {
throw new IllegalStateException("failed to create event type cache", e);
}
}
Aggregations