@Test public void doAction() throws PersistenceException { when(valueMap.remove(ATTR)).thenReturn("val"); DeleteProperty action = new DeleteProperty(ATTR); action.doAction(resource); verify(valueMap, times(1)).remove(ATTR); }
@Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.remove(name); return "Deleting property " + name + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); }
DeleteProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.remove(name); return "Deleting property " + name + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } }
DeleteProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.remove(name); return "Deleting property " + name + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } DeleteProperty(@Nonnull String name); }
DeleteProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.remove(name); return "Deleting property " + name + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } DeleteProperty(@Nonnull String name); @Override String doAction(@Nonnull Resource resource); }
DeleteProperty implements Action { @Override public String doAction(@Nonnull Resource resource) { ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class); if (properties != null) { properties.remove(name); return "Deleting property " + name + " for resource " + resource.getPath(); } return "WARNING: could not get ModifiableValueMap for resource " + resource.getPath(); } DeleteProperty(@Nonnull String name); @Override String doAction(@Nonnull Resource resource);  }