PassivateCapabilityDuringUpdateCondition extends ConditionSupport implements CapabilityContextAware { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.BeforeUpdate event) { if (event.getReference().context().id().equals(id)) { if (propertyNames == null) { setSatisfied(false); } else { for (final String propertyName : propertyNames) { String oldValue = event.properties().get(propertyName); if (oldValue == null) { oldValue = ""; } String newValue = event.previousProperties().get(propertyName); if (newValue == null) { newValue = ""; } if (isSatisfied() && !oldValue.equals(newValue)) { setSatisfied(false); } } } } } PassivateCapabilityDuringUpdateCondition(final EventManager eventManager,
                                                  final String... propertyNames); @Override PassivateCapabilityDuringUpdateCondition setContext(final CapabilityContext context); @Override void doRelease(); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.BeforeUpdate event); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.AfterUpdate event); @Override String toString(); @Override String explainSatisfied(); @Override String explainUnsatisfied();  }
@Test public void passivateDuringUpdate() { underTest.handle(new CapabilityEvent.BeforeUpdate( capabilityRegistry, reference, Maps.<String, String>newHashMap(), Maps.<String, String>newHashMap() )); underTest.handle(new CapabilityEvent.AfterUpdate( capabilityRegistry, reference, Maps.<String, String>newHashMap(), Maps.<String, String>newHashMap() )); verifyEventManagerEvents(unsatisfied(underTest), satisfied(underTest)); }