Search in sources :

Example 1 with BasicOutputCollector

use of org.apache.storm.topology.BasicOutputCollector in project storm by apache.

the class IntermediateRankingsBoltTest method shouldEmitNothingIfNormalTupleIsReceived.

@Test
public void shouldEmitNothingIfNormalTupleIsReceived() {
    // given
    Tuple normalTuple = mockRankableTuple(ANY_OBJECT, ANY_COUNT);
    BasicOutputCollector collector = mock(BasicOutputCollector.class);
    IntermediateRankingsBolt bolt = new IntermediateRankingsBolt();
    // when
    bolt.execute(normalTuple, collector);
    // then
    verifyZeroInteractions(collector);
}
Also used : BasicOutputCollector(org.apache.storm.topology.BasicOutputCollector) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Example 2 with BasicOutputCollector

use of org.apache.storm.topology.BasicOutputCollector in project storm by apache.

the class TotalRankingsBoltTest method shouldEmitNothingIfNormalTupleIsReceived.

@Test
public void shouldEmitNothingIfNormalTupleIsReceived() {
    // given
    Tuple normalTuple = mockRankingsTuple(ANY_OBJECT, ANY_COUNT);
    BasicOutputCollector collector = mock(BasicOutputCollector.class);
    TotalRankingsBolt bolt = new TotalRankingsBolt();
    // when
    bolt.execute(normalTuple, collector);
    // then
    verifyZeroInteractions(collector);
}
Also used : BasicOutputCollector(org.apache.storm.topology.BasicOutputCollector) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Example 3 with BasicOutputCollector

use of org.apache.storm.topology.BasicOutputCollector in project storm by apache.

the class IntermediateRankingsBoltTest method shouldEmitSomethingIfTickTupleIsReceived.

@Test
public void shouldEmitSomethingIfTickTupleIsReceived() {
    // given
    Tuple tickTuple = MockTupleHelpers.mockTickTuple();
    BasicOutputCollector collector = mock(BasicOutputCollector.class);
    IntermediateRankingsBolt bolt = new IntermediateRankingsBolt();
    // when
    bolt.execute(tickTuple, collector);
    // then
    // verifyZeroInteractions(collector);
    verify(collector).emit(any(Values.class));
}
Also used : Values(org.apache.storm.tuple.Values) BasicOutputCollector(org.apache.storm.topology.BasicOutputCollector) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Example 4 with BasicOutputCollector

use of org.apache.storm.topology.BasicOutputCollector in project storm by apache.

the class TotalRankingsBoltTest method shouldEmitSomethingIfTickTupleIsReceived.

@Test
public void shouldEmitSomethingIfTickTupleIsReceived() {
    // given
    Tuple tickTuple = MockTupleHelpers.mockTickTuple();
    BasicOutputCollector collector = mock(BasicOutputCollector.class);
    TotalRankingsBolt bolt = new TotalRankingsBolt();
    // when
    bolt.execute(tickTuple, collector);
    // then
    // verifyZeroInteractions(collector);
    verify(collector).emit(any(Values.class));
}
Also used : Values(org.apache.storm.tuple.Values) BasicOutputCollector(org.apache.storm.topology.BasicOutputCollector) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Aggregations

BasicOutputCollector (org.apache.storm.topology.BasicOutputCollector)4 Tuple (org.apache.storm.tuple.Tuple)4 Test (org.testng.annotations.Test)4 Values (org.apache.storm.tuple.Values)2