use of org.apache.kafka.streams.processor.TopologyBuilder.TopicsInfo in project kafka by apache.
the class TopologyBuilderTest method shouldAddInternalTopicConfigWithCompactForNonWindowStores.
@SuppressWarnings("unchecked")
@Test
public void shouldAddInternalTopicConfigWithCompactForNonWindowStores() throws Exception {
final TopologyBuilder builder = new TopologyBuilder();
builder.setApplicationId("appId");
builder.addSource("source", "topic");
builder.addProcessor("processor", new MockProcessorSupplier(), "source");
builder.addStateStore(new MockStateStoreSupplier("name", true), "processor");
final Map<Integer, TopicsInfo> topicGroups = builder.topicGroups();
final TopicsInfo topicsInfo = topicGroups.values().iterator().next();
final InternalTopicConfig topicConfig = topicsInfo.stateChangelogTopics.get("appId-name-changelog");
final Properties properties = topicConfig.toProperties(0);
assertEquals("appId-name-changelog", topicConfig.name());
assertEquals("compact", properties.getProperty(InternalTopicManager.CLEANUP_POLICY_PROP));
assertEquals(1, properties.size());
}
Aggregations