@Test public void testAndMiddleConditionTrue() throws Exception { when(mockConditionOne.evaluate(adaptrisMessage)).thenReturn(false); when(mockConditionTwo.evaluate(adaptrisMessage)).thenReturn(true); when(mockConditionThree.evaluate(adaptrisMessage)).thenReturn(false); assertFalse(conditionAnd.evaluate(adaptrisMessage)); verify(mockConditionOne).evaluate(adaptrisMessage); verify(mockConditionTwo, times(0)).evaluate(adaptrisMessage); verify(mockConditionThree, times(0)).evaluate(adaptrisMessage); }
@Override public boolean evaluate(AdaptrisMessage message) throws CoreException { if(this.getConditions().size() == 0) return false; boolean returnValue = true; for(Condition condition : this.getConditions()) { if(!condition.evaluate(message)) { returnValue = false; break; } } return returnValue; }
ConditionAnd extends ConditionListImpl { @Override public boolean evaluate(AdaptrisMessage message) throws CoreException { if(this.getConditions().size() == 0) return false; boolean returnValue = true; for(Condition condition : this.getConditions()) { if(!condition.evaluate(message)) { returnValue = false; break; } } return returnValue; } }
ConditionAnd extends ConditionListImpl { @Override public boolean evaluate(AdaptrisMessage message) throws CoreException { if(this.getConditions().size() == 0) return false; boolean returnValue = true; for(Condition condition : this.getConditions()) { if(!condition.evaluate(message)) { returnValue = false; break; } } return returnValue; } ConditionAnd(); }
ConditionAnd extends ConditionListImpl { @Override public boolean evaluate(AdaptrisMessage message) throws CoreException { if(this.getConditions().size() == 0) return false; boolean returnValue = true; for(Condition condition : this.getConditions()) { if(!condition.evaluate(message)) { returnValue = false; break; } } return returnValue; } ConditionAnd(); @Override boolean evaluate(AdaptrisMessage message); }
ConditionAnd extends ConditionListImpl { @Override public boolean evaluate(AdaptrisMessage message) throws CoreException { if(this.getConditions().size() == 0) return false; boolean returnValue = true; for(Condition condition : this.getConditions()) { if(!condition.evaluate(message)) { returnValue = false; break; } } return returnValue; } ConditionAnd(); @Override boolean evaluate(AdaptrisMessage message);  }