use of org.apache.metron.writer.NoopWriter in project metron by apache.
the class ParserTopologyBuilderTest method shouldCreateWriterConfigWithWriterClassName.
@Test
public void shouldCreateWriterConfigWithWriterClassName() {
SensorParserConfig yafConfig = new SensorParserConfig();
yafConfig.setSensorTopic("yaf");
yafConfig.setWriterClassName("org.apache.metron.writer.NoopWriter");
when(configs.getSensorParserConfig("yaf")).thenReturn(yafConfig);
Map<String, SensorParserConfig> sensorTypeToParserConfig = new HashMap<String, SensorParserConfig>() {
{
put("yaf", yafConfig);
}
};
Map<String, WriterHandler> writerConfigs = ParserTopologyBuilder.createWriterConfigs("zookeeperUrl", Optional.of("brokerUrl"), sensorTypeToParserConfig, Optional.of("securityProtocol"), configs, Optional.empty());
assertEquals(1, writerConfigs.size());
assertTrue(writerConfigs.get("yaf").getBulkMessageWriter() instanceof NoopWriter);
}
Aggregations