assertTrue(messageOutputs.contains(messageOutput));
}
public void testGetMessageOutputsForStreamWithTwoOutputs() throws Exception {
final Stream stream = mock(Stream.class);
final Output output1 = mock(Output.class);
final Output output2 = mock(Output.class);
final String output1Id = "foo";
final String output2Id = "bar";
final MessageOutput messageOutput1 = mock(MessageOutput.class);
final MessageOutput messageOutput2 = mock(MessageOutput.class);
final Set<Output> outputSet = new HashSet<Output>() {{ add(output1); add(output2); }};
when(stream.getOutputs()).thenReturn(outputSet);
when(output1.getId()).thenReturn(output1Id);
when(output2.getId()).thenReturn(output2Id);
when(outputRegistry.getOutputForId(eq(output1Id))).thenReturn(messageOutput1);
when(outputRegistry.getOutputForId(eq(output2Id))).thenReturn(messageOutput2);
final OutputRouter outputRouter = new OutputRouter(defaultMessageOutput, outputRegistry);
final Collection<MessageOutput> messageOutputs = outputRouter.getMessageOutputsForStream(stream);