@Test public void shouldUpdateLocalListVersionWhenCommandWasExecuted() { final ListPropertyMetaData metaData = new ListPropertyMetaData(randomUUID(), randomUUID()); when(listMetaData.getMetaDataOrFail(exemplaryListId)).thenReturn(metaData); final AddToList command = new AddToList(exemplaryListId, exemplaryVersionChange, new Value("second"), 0); cut.execute(command); assertThat(metaData.getLocalVersion()).isEqualTo(exemplaryVersionChange.getToVersion()); }
@Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } SimpleListPropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor silentChangeExecutor, final ValueMapper valueMapper,
            final ListPropertyMetaDataStore listVersions); }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } SimpleListPropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor silentChangeExecutor, final ValueMapper valueMapper,
            final ListPropertyMetaDataStore listVersions); @Override void execute(final AddToList command); @Override void execute(final RemoveFromList command); @Override void execute(final ReplaceInList command); }
SimpleListPropertyCommandExecutor implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { final List<Object> list = getListOrFail(command); final Object value = valueMapper.map(command.getValue()); silentChangeExecutor.execute(list, new Runnable() { @Override public void run() { list.add(command.getPosition(), value); } }); updateVersion(command); } SimpleListPropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor silentChangeExecutor, final ValueMapper valueMapper,
            final ListPropertyMetaDataStore listVersions); @Override void execute(final AddToList command); @Override void execute(final RemoveFromList command); @Override void execute(final ReplaceInList command);  }