use of org.apache.samza.system.descriptors.examples.serde.ExampleSimpleSystemDescriptor in project samza by apache.
the class TestSimpleInputDescriptor method testISDObjectsWithOverrides.
@Test
public void testISDObjectsWithOverrides() {
ExampleSimpleSystemDescriptor ssd = new ExampleSimpleSystemDescriptor("kafka-system");
IntegerSerde streamSerde = new IntegerSerde();
ExampleSimpleInputDescriptor<Integer> isd = ssd.getInputDescriptor("input-stream", streamSerde);
assertEquals(streamSerde, isd.getSerde());
assertFalse(isd.getTransformer().isPresent());
}
use of org.apache.samza.system.descriptors.examples.serde.ExampleSimpleSystemDescriptor in project samza by apache.
the class TestSimpleInputDescriptor method testAPIUsage.
@Test
public void testAPIUsage() {
// does not assert anything, but acts as a compile-time check on expected descriptor type parameters
// and validates that the method calls can be chained.
ExampleSimpleSystemDescriptor kafkaSystem = new ExampleSimpleSystemDescriptor("kafka-system").withSystemConfigs(Collections.emptyMap());
ExampleSimpleInputDescriptor<Integer> input1 = kafkaSystem.getInputDescriptor("input1", new IntegerSerde());
ExampleSimpleOutputDescriptor<Integer> output1 = kafkaSystem.getOutputDescriptor("output1", new IntegerSerde());
input1.shouldBootstrap().withOffsetDefault(SystemStreamMetadata.OffsetType.NEWEST).withPriority(1).shouldResetOffset().withStreamConfigs(Collections.emptyMap());
output1.withStreamConfigs(Collections.emptyMap());
}
Aggregations