Search in sources :

Example 1 with NoopWriter

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);
}
Also used : NoopWriter(org.apache.metron.writer.NoopWriter) HashMap(java.util.HashMap) WriterHandler(org.apache.metron.parsers.bolt.WriterHandler) SensorParserConfig(org.apache.metron.common.configuration.SensorParserConfig) Test(org.junit.jupiter.api.Test)

Aggregations

HashMap (java.util.HashMap)1 SensorParserConfig (org.apache.metron.common.configuration.SensorParserConfig)1 WriterHandler (org.apache.metron.parsers.bolt.WriterHandler)1 NoopWriter (org.apache.metron.writer.NoopWriter)1 Test (org.junit.jupiter.api.Test)1