use of nl.minvenj.nfi.storm.kafka.fail.ReliableFailHandler in project kafka-spout by HolmesNL.
the class KafkaSpoutFailurePolicyTest method testReliableFailure.
@Test
public void testReliableFailure() {
final FailHandler reliable = spy(new ReliableFailHandler());
_subject._failHandler = reliable;
final KafkaMessageId id = new KafkaMessageId(1, 1234);
final byte[] message = { 1, 2, 3, 4 };
_subject._inProgress.put(id, message);
// fail the message
_subject.fail(id);
// verify decision delegate to fail handler and replay
verify(reliable).shouldReplay(eq(id));
assertEquals(id, _subject._queue.peek());
assertTrue(_subject._inProgress.containsKey(id));
}
Aggregations