CompositeConditionSupport extends ConditionSupport implements CapabilityContextAware { @AllowConcurrentEvents @Subscribe public void handle(final ConditionEvent.Satisfied event) { if (shouldReevaluateFor(event.getCondition())) { setSatisfied(reevaluate(conditions)); } } CompositeConditionSupport(final EventManager eventManager,
                                   final Condition... conditions);  CompositeConditionSupport(final EventManager eventManager,
                                   final Condition condition); @Override void doRelease(); @AllowConcurrentEvents @Subscribe void handle(final ConditionEvent.Satisfied event); @AllowConcurrentEvents @Subscribe void handle(final ConditionEvent.Unsatisfied event); @Override CompositeConditionSupport setContext(final CapabilityContext context); @Override String toString();  }
@Test public void whenMemberConditionIsSatisfiedAndReevaluateReturnsTrue() { when(c1.isSatisfied()).thenReturn(true); underTest.handle(new ConditionEvent.Satisfied(c1)); assertThat(underTest.isSatisfied(), is(true)); verifyEventManagerEvents(satisfied(underTest)); }
@Test public void whenMemberConditionIsSatisfiedAndCheckReturnsFalse() { when(c1.isSatisfied()).thenReturn(true); underTest.handle(new ConditionEvent.Satisfied(c1)); when(c1.isSatisfied()).thenReturn(false); when(c2.isSatisfied()).thenReturn(false); underTest.handle(new ConditionEvent.Satisfied(c2)); assertThat(underTest.isSatisfied(), is(false)); verifyEventManagerEvents(satisfied(underTest), unsatisfied(underTest)); }
@Test public void whenMemberConditionIsUnsatisfiedAndCheckReturnsTrue() { when(c1.isSatisfied()).thenReturn(false); when(c2.isSatisfied()).thenReturn(true); underTest.handle(new ConditionEvent.Unsatisfied(c1)); assertThat(underTest.isSatisfied(), is(true)); verifyEventManagerEvents(satisfied(underTest)); }
@Test public void whenMemberConditionIsUnsatisfiedAndCheckReturnsFalse() { when(c1.isSatisfied()).thenReturn(false); when(c2.isSatisfied()).thenReturn(true); underTest.handle(new ConditionEvent.Unsatisfied(c1)); when(c1.isSatisfied()).thenReturn(false); when(c2.isSatisfied()).thenReturn(false); underTest.handle(new ConditionEvent.Unsatisfied(c2)); assertThat(underTest.isSatisfied(), is(false)); verifyEventManagerEvents(satisfied(underTest), unsatisfied(underTest)); }