Search in sources :

Example 1 with SchemaRegistry

use of io.divolte.server.SchemaRegistry in project divolte-collector by divolte.

the class SchemaRegistryTest method testSchemaForUnknownSinkThrowsException.

@Test(expected = IllegalArgumentException.class)
public void testSchemaForUnknownSinkThrowsException() {
    final ValidatedConfiguration vc = new ValidatedConfiguration(() -> ConfigFactory.parseResources("reference.conf"));
    final SchemaRegistry registry = new SchemaRegistry(vc);
    // This throws an exception if the sink is unknown.
    registry.getSchemaBySinkName("an-unknown-sink");
}
Also used : SchemaRegistry(io.divolte.server.SchemaRegistry) Test(org.junit.Test)

Example 2 with SchemaRegistry

use of io.divolte.server.SchemaRegistry in project divolte-collector by divolte.

the class SchemaRegistryTest method testConfluentSinkCorrectlyAssociatedWithSchemaId.

@Test
public void testConfluentSinkCorrectlyAssociatedWithSchemaId() {
    final ValidatedConfiguration vc = new ValidatedConfiguration(() -> ConfigFactory.parseResources("schema-registry-with-confluent.conf"));
    final SchemaRegistry registry = new SchemaRegistry(vc);
    final DivolteSchema schema = registry.getSchemaBySinkName("kafka");
    assertEquals(schema.confluentId, Optional.of(12345));
}
Also used : SchemaRegistry(io.divolte.server.SchemaRegistry) DivolteSchema(io.divolte.server.DivolteSchema) Test(org.junit.Test)

Example 3 with SchemaRegistry

use of io.divolte.server.SchemaRegistry in project divolte-collector by divolte.

the class SchemaRegistryTest method testSinkCorrectlyAssociatedWithSchema.

@Test
public void testSinkCorrectlyAssociatedWithSchema() {
    final ValidatedConfiguration vc = new ValidatedConfiguration(() -> ConfigFactory.parseResources("schema-registry-with-confluent.conf"));
    final SchemaRegistry registry = new SchemaRegistry(vc);
    // This throws an exception if the sink is unknown.
    registry.getSchemaBySinkName("kafka");
}
Also used : SchemaRegistry(io.divolte.server.SchemaRegistry) Test(org.junit.Test)

Example 4 with SchemaRegistry

use of io.divolte.server.SchemaRegistry in project divolte-collector by divolte.

the class SchemaRegistryTest method testSchemaForUnknownMappingThrowsException.

@Test(expected = IllegalArgumentException.class)
public void testSchemaForUnknownMappingThrowsException() {
    final ValidatedConfiguration vc = new ValidatedConfiguration(() -> ConfigFactory.parseResources("reference.conf"));
    final SchemaRegistry registry = new SchemaRegistry(vc);
    // This throws an exception if the mapping is unknown.
    registry.getSchemaByMappingName("an-unknown-mapping");
}
Also used : SchemaRegistry(io.divolte.server.SchemaRegistry) Test(org.junit.Test)

Aggregations

SchemaRegistry (io.divolte.server.SchemaRegistry)4 Test (org.junit.Test)4 DivolteSchema (io.divolte.server.DivolteSchema)1