@Test public void capabilityOfTypeActive06() { doReturn(Arrays.asList(ref1)).when(capabilityRegistry).getAll(); when(ref1.context().isActive()).thenReturn(true); underTest.handle(new CapabilityEvent.Created(capabilityRegistry, ref1)); assertThat(underTest.isSatisfied(), is(true)); doReturn(Collections.emptyList()).when(capabilityRegistry).getAll(); underTest.handle(new CapabilityEvent.AfterRemove(capabilityRegistry, ref1)); assertThat(underTest.isSatisfied(), is(false)); verifyEventManagerEvents(satisfied(underTest), unsatisfied(underTest)); }
@AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.AfterActivated event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } }
CapabilityOfTypeActiveCondition extends CapabilityOfTypeExistsCondition { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.AfterActivated event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } }
CapabilityOfTypeActiveCondition extends CapabilityOfTypeExistsCondition { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.AfterActivated event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } CapabilityOfTypeActiveCondition(final EventManager eventManager,
                                         final CapabilityDescriptorRegistry descriptorRegistry,
                                         final CapabilityRegistry capabilityRegistry,
                                         final CapabilityType type); }
CapabilityOfTypeActiveCondition extends CapabilityOfTypeExistsCondition { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.AfterActivated event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } CapabilityOfTypeActiveCondition(final EventManager eventManager,
                                         final CapabilityDescriptorRegistry descriptorRegistry,
                                         final CapabilityRegistry capabilityRegistry,
                                         final CapabilityType type); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.AfterActivated event); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.BeforePassivated event); @Override String toString(); @Override String explainSatisfied(); @Override String explainUnsatisfied(); }
CapabilityOfTypeActiveCondition extends CapabilityOfTypeExistsCondition { @AllowConcurrentEvents @Subscribe public void handle(final CapabilityEvent.AfterActivated event) { if (!isSatisfied() && type.equals(event.getReference().context().type())) { checkAllCapabilities(); } } CapabilityOfTypeActiveCondition(final EventManager eventManager,
                                         final CapabilityDescriptorRegistry descriptorRegistry,
                                         final CapabilityRegistry capabilityRegistry,
                                         final CapabilityType type); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.AfterActivated event); @AllowConcurrentEvents @Subscribe void handle(final CapabilityEvent.BeforePassivated event); @Override String toString(); @Override String explainSatisfied(); @Override String explainUnsatisfied();  }