@Test public void shouldChangeTheDomainModelOfTheUserWithoutNotifingTheListeners() { doAnswer(new Answer<Object>() { @Override public Object answer(final InvocationOnMock invocation) { return null; } }).when(silentChangeExecutor).execute(any(), any(Runnable.class)); cut.execute(exemplaryProperty1Change); verify(silentChangeExecutor).execute(any(), any(Runnable.class)); assertThat(exemplaryProperty1.get()).isEqualTo(exemplaryProperty1Value); }
@Override public void execute(final SetPropertyValue command) { @SuppressWarnings("unchecked") final Property<Object> property = (Property<Object>) objectRegistry.getByIdOrFail(command.getPropertyId()); changeExecutor.execute(property, new Runnable() { @Override public void run() { property.setValue(valueMapper.map(command.getValue())); } }); }
SimpleSingleValuePropertyCommandExecutor implements SingleValuePropertyCommandExecutor { @Override public void execute(final SetPropertyValue command) { @SuppressWarnings("unchecked") final Property<Object> property = (Property<Object>) objectRegistry.getByIdOrFail(command.getPropertyId()); changeExecutor.execute(property, new Runnable() { @Override public void run() { property.setValue(valueMapper.map(command.getValue())); } }); } }
SimpleSingleValuePropertyCommandExecutor implements SingleValuePropertyCommandExecutor { @Override public void execute(final SetPropertyValue command) { @SuppressWarnings("unchecked") final Property<Object> property = (Property<Object>) objectRegistry.getByIdOrFail(command.getPropertyId()); changeExecutor.execute(property, new Runnable() { @Override public void run() { property.setValue(valueMapper.map(command.getValue())); } }); } SimpleSingleValuePropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor changeExecutor, final ValueMapper valueMapper); }
SimpleSingleValuePropertyCommandExecutor implements SingleValuePropertyCommandExecutor { @Override public void execute(final SetPropertyValue command) { @SuppressWarnings("unchecked") final Property<Object> property = (Property<Object>) objectRegistry.getByIdOrFail(command.getPropertyId()); changeExecutor.execute(property, new Runnable() { @Override public void run() { property.setValue(valueMapper.map(command.getValue())); } }); } SimpleSingleValuePropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor changeExecutor, final ValueMapper valueMapper); @Override void execute(final SetPropertyValue command); }
SimpleSingleValuePropertyCommandExecutor implements SingleValuePropertyCommandExecutor { @Override public void execute(final SetPropertyValue command) { @SuppressWarnings("unchecked") final Property<Object> property = (Property<Object>) objectRegistry.getByIdOrFail(command.getPropertyId()); changeExecutor.execute(property, new Runnable() { @Override public void run() { property.setValue(valueMapper.map(command.getValue())); } }); } SimpleSingleValuePropertyCommandExecutor(final WeakObjectRegistry objectRegistry,
            final SilentChangeExecutor changeExecutor, final ValueMapper valueMapper); @Override void execute(final SetPropertyValue command);  }