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);  }
@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); }