use of org.testng.annotations.Test 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);
}
use of org.testng.annotations.Test in project storm by apache.
the class RollingCountBoltTest method shouldEmitNothingIfNoObjectHasBeenCountedYetAndTickTupleIsReceived.
@SuppressWarnings("rawtypes")
@Test
public void shouldEmitNothingIfNoObjectHasBeenCountedYetAndTickTupleIsReceived() {
// given
Tuple tickTuple = MockTupleHelpers.mockTickTuple();
RollingCountBolt bolt = new RollingCountBolt();
Map conf = mock(Map.class);
TopologyContext context = mock(TopologyContext.class);
OutputCollector collector = mock(OutputCollector.class);
bolt.prepare(conf, context, collector);
// when
bolt.execute(tickTuple);
// then
verifyZeroInteractions(collector);
}
use of org.testng.annotations.Test in project storm by apache.
the class RollingCountBoltTest method shouldDeclareOutputFields.
@Test
public void shouldDeclareOutputFields() {
// given
OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class);
RollingCountBolt bolt = new RollingCountBolt();
// when
bolt.declareOutputFields(declarer);
// then
verify(declarer, times(1)).declare(any(Fields.class));
}
use of org.testng.annotations.Test 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);
}
use of org.testng.annotations.Test in project storm by apache.
the class TotalRankingsBoltTest method shouldDeclareOutputFields.
@Test
public void shouldDeclareOutputFields() {
// given
OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class);
TotalRankingsBolt bolt = new TotalRankingsBolt();
// when
bolt.declareOutputFields(declarer);
// then
verify(declarer, times(1)).declare(any(Fields.class));
}
Aggregations