Search in sources :

Example 1 with OutputCollectorMock

use of org.openkilda.wfm.topology.OutputCollectorMock in project open-kilda by telstra.

the class OFELinkBoltTest method before.

@Before
public void before() throws CmdLineException, ConfigurationException {
    OFEventWFMTopology manager = new OFEventWFMTopology(AbstractStormTest.makeLaunchEnvironment());
    config = manager.getConfig();
    bolt = new OFELinkBolt(config);
    context = Mockito.mock(TopologyContext.class);
    Mockito.when(context.getComponentId(TASK_ID_BOLT)).thenReturn(COMPONENT_ID_SOURCE);
    Mockito.when(context.getComponentOutputFields(COMPONENT_ID_SOURCE, STREAM_ID_INPUT)).thenReturn(KafkaMessage.FORMAT);
    outputDelegate = Mockito.spy(new OutputCollectorMock());
    OutputCollector output = new OutputCollector(outputDelegate);
    bolt.prepare(stormConfig(), context, output);
    bolt.initState(new InMemoryKeyValueState<>());
}
Also used : OutputCollector(org.apache.storm.task.OutputCollector) OutputCollectorMock(org.openkilda.wfm.topology.OutputCollectorMock) TopologyContext(org.apache.storm.task.TopologyContext) Before(org.junit.Before)

Aggregations

OutputCollector (org.apache.storm.task.OutputCollector)1 TopologyContext (org.apache.storm.task.TopologyContext)1 Before (org.junit.Before)1 OutputCollectorMock (org.openkilda.wfm.topology.OutputCollectorMock)1