@Test public void doAction() throws PersistenceException { SetProperty action = new SetProperty(ATTR, VAL1); action.doAction(resource); verify(valueMap, times(1)).put(ATTR, VAL1); }
@Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.put(name, value); return "Setting " + value.getClass().getSimpleName() + " property " + name + "=" + value + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); }
SetProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.put(name, value); return "Setting " + value.getClass().getSimpleName() + " property " + name + "=" + value + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } }
SetProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.put(name, value); return "Setting " + value.getClass().getSimpleName() + " property " + name + "=" + value + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } SetProperty(@Nonnull String name, Object value); }
SetProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.put(name, value); return "Setting " + value.getClass().getSimpleName() + " property " + name + "=" + value + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } SetProperty(@Nonnull String name, Object value); @Override String doAction(@Nonnull Resource resource); }
SetProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.put(name, value); return "Setting " + value.getClass().getSimpleName() + " property " + name + "=" + value + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } SetProperty(@Nonnull String name, Object value); @Override String doAction(@Nonnull Resource resource);  }