@Test public void capabilityOfTypeExists04() { doReturn(Arrays.asList(ref1)).when(capabilityRegistry).getAll(); underTest.handle(new CapabilityEvent.Created(capabilityRegistry, ref1)); assertThat(underTest.isSatisfied(), is(true)); doReturn(Arrays.asList(ref1, ref2)).when(capabilityRegistry).getAll(); underTest.handle(new CapabilityEvent.Created(capabilityRegistry, ref2)); assertThat(underTest.isSatisfied(), is(true)); doReturn(Arrays.asList(ref2)).when(capabilityRegistry).getAll(); underTest.handle(new CapabilityEvent.AfterRemove(capabilityRegistry, ref1)); assertThat(underTest.isSatisfied(), is(true)); verifyEventManagerEvents(satisfied(underTest)); }
@AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.Created event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } }
CapabilityOfTypeExistsCondition extends ConditionSupport { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.Created event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } }
CapabilityOfTypeExistsCondition extends ConditionSupport { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.Created event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } CapabilityOfTypeExistsCondition(final EventManager eventManager,
                                         final CapabilityDescriptorRegistry descriptorRegistry,
                                         final CapabilityRegistry capabilityRegistry,
                                         final CapabilityType type); }
CapabilityOfTypeExistsCondition extends ConditionSupport { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.Created event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } CapabilityOfTypeExistsCondition(final EventManager eventManager,
                                         final CapabilityDescriptorRegistry descriptorRegistry,
                                         final CapabilityRegistry capabilityRegistry,
                                         final CapabilityType type); @Override void doRelease(); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.Created event); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.AfterRemove event); @Override String toString(); @Override String explainSatisfied(); @Override String explainUnsatisfied(); }
CapabilityOfTypeExistsCondition extends ConditionSupport { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.Created event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } CapabilityOfTypeExistsCondition(final EventManager eventManager,
                                         final CapabilityDescriptorRegistry descriptorRegistry,
                                         final CapabilityRegistry capabilityRegistry,
                                         final CapabilityType type); @Override void doRelease(); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.Created event); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.AfterRemove event); @Override String toString(); @Override String explainSatisfied(); @Override String explainUnsatisfied();  }