Sets.newHashSet(filterOnlyFirst),
configuration,
processBufferWatermark, 0, 1,
outputBuffer);
try {
Message filteredoutMessage = new Message("filtered out", "source", Tools.iso8601());
Message unfilteredMessage = new Message("filtered out", "source", Tools.iso8601());
filterTest.handleMessage(filteredoutMessage);
filterTest.handleMessage(unfilteredMessage);
verify(outputBuffer, times(0)).insertCached(same(filteredoutMessage), Matchers.<MessageInput>anyObject());
verify(outputBuffer, times(1)).insertCached(same(unfilteredMessage), Matchers.<MessageInput>anyObject());
assertTrue(filteredoutMessage.getFilterOut());
assertFalse(unfilteredMessage.getFilterOut());
} catch (RuntimeException e) {
fail("This test should not throw exceptions", e);
}
}