@Test public void dispatchesSetPropertyValueToSingleValuePropertyCommandExecutor() { final SetPropertyValue msg1 = new SetPropertyValue(UUID.randomUUID(), new Value("exampleValue")); final SetPropertyValue msg2 = new SetPropertyValue(UUID.randomUUID(), new Value(UUID.randomUUID())); final List<Command> commands = Arrays.asList(new PutToMap(), mock(ReplaceInList.class), msg1, new Command() { }, msg2); cut.logLocalCommands(commands); verify(singleValue, times(2)).logLocalCommand(setPropertyValueCaptor.capture()); assertThat(setPropertyValueCaptor.getAllValues().get(0)).isEqualTo(msg1); assertThat(setPropertyValueCaptor.getAllValues().get(1)).isEqualTo(msg2); }
public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } CommandLogDispatcher(final RepairingSingleValuePropertyCommandExecutor singleValue,
            final ReparingListPropertyCommandExecutor lists);  CommandLogDispatcher(); }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } CommandLogDispatcher(final RepairingSingleValuePropertyCommandExecutor singleValue,
            final ReparingListPropertyCommandExecutor lists);  CommandLogDispatcher(); void logLocalCommands(final List<Command> commands); }
CommandLogDispatcher { public void logLocalCommands(final List<Command> commands) { if (singleValue == null) { return; } for (final Command command : commands) { if (command instanceof SetPropertyValue) { singleValue.logLocalCommand((SetPropertyValue) command); } else if (command instanceof ListCommand) { lists.logLocalCommand((ListCommand) command); } } } CommandLogDispatcher(final RepairingSingleValuePropertyCommandExecutor singleValue,
            final ReparingListPropertyCommandExecutor lists);  CommandLogDispatcher(); void logLocalCommands(final List<Command> commands);  }