@Test @SuppressWarnings("unchecked") public void testExecute() { assertEquals(CommandResult.Type.INFO, command.execute(graphCommandExecutionContext).getType()); verify(propertyAdapter).getValue(eq(domainObject.getNameProperty())); verify(propertyAdapter).setValue(eq(domainObject.getNameProperty()), eq(PROPERTY_VALUE)); }
@Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final DefinitionManager definitionManager = context.getDefinitionManager(); final Object p = definitionManager.adapters().forDefinition().getProperty(domainObject, field).get(); final AdapterManager adapterManager = definitionManager.adapters(); final AdapterRegistry adapterRegistry = adapterManager.registry(); final PropertyAdapter<Object, Object> adapter = (PropertyAdapter<Object, Object>) adapterRegistry.getPropertyAdapter(p.getClass()); oldValue = adapter.getValue(p); adapter.setValue(p, value); return GraphCommandResultBuilder.SUCCESS; }
UpdateDomainObjectPropertyValueCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final DefinitionManager definitionManager = context.getDefinitionManager(); final Object p = definitionManager.adapters().forDefinition().getProperty(domainObject, field).get(); final AdapterManager adapterManager = definitionManager.adapters(); final AdapterRegistry adapterRegistry = adapterManager.registry(); final PropertyAdapter<Object, Object> adapter = (PropertyAdapter<Object, Object>) adapterRegistry.getPropertyAdapter(p.getClass()); oldValue = adapter.getValue(p); adapter.setValue(p, value); return GraphCommandResultBuilder.SUCCESS; } }
UpdateDomainObjectPropertyValueCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final DefinitionManager definitionManager = context.getDefinitionManager(); final Object p = definitionManager.adapters().forDefinition().getProperty(domainObject, field).get(); final AdapterManager adapterManager = definitionManager.adapters(); final AdapterRegistry adapterRegistry = adapterManager.registry(); final PropertyAdapter<Object, Object> adapter = (PropertyAdapter<Object, Object>) adapterRegistry.getPropertyAdapter(p.getClass()); oldValue = adapter.getValue(p); adapter.setValue(p, value); return GraphCommandResultBuilder.SUCCESS; } UpdateDomainObjectPropertyValueCommand(final @MapsTo("domainObject") DomainObject domainObject,
                                                  final @MapsTo("field") String field,
                                                  final @MapsTo("value") Object value); }
UpdateDomainObjectPropertyValueCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final DefinitionManager definitionManager = context.getDefinitionManager(); final Object p = definitionManager.adapters().forDefinition().getProperty(domainObject, field).get(); final AdapterManager adapterManager = definitionManager.adapters(); final AdapterRegistry adapterRegistry = adapterManager.registry(); final PropertyAdapter<Object, Object> adapter = (PropertyAdapter<Object, Object>) adapterRegistry.getPropertyAdapter(p.getClass()); oldValue = adapter.getValue(p); adapter.setValue(p, value); return GraphCommandResultBuilder.SUCCESS; } UpdateDomainObjectPropertyValueCommand(final @MapsTo("domainObject") DomainObject domainObject,
                                                  final @MapsTo("field") String field,
                                                  final @MapsTo("value") Object value); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @Override String toString(); }
UpdateDomainObjectPropertyValueCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final DefinitionManager definitionManager = context.getDefinitionManager(); final Object p = definitionManager.adapters().forDefinition().getProperty(domainObject, field).get(); final AdapterManager adapterManager = definitionManager.adapters(); final AdapterRegistry adapterRegistry = adapterManager.registry(); final PropertyAdapter<Object, Object> adapter = (PropertyAdapter<Object, Object>) adapterRegistry.getPropertyAdapter(p.getClass()); oldValue = adapter.getValue(p); adapter.setValue(p, value); return GraphCommandResultBuilder.SUCCESS; } UpdateDomainObjectPropertyValueCommand(final @MapsTo("domainObject") DomainObject domainObject,
                                                  final @MapsTo("field") String field,
                                                  final @MapsTo("value") Object value); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @Override String toString();  }