IsVitaminA6DoseGivenRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return VITAMIN_A_DOSE_6_VALUE.equalsIgnoreCase(reportFields.get(VITAMIN_A_DOSE)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnTrueIfVitaminA6DoseIsGiven() { SafeMap safeMap = new SafeMap(create("vitaminADose", "6").map()); boolean didRuleApply = rule.apply(safeMap); assertTrue(didRuleApply); }
@Test public void shouldReturnFalseIfVitaminA6DoseIsNotGiven() { boolean didRuleApply = rule.apply(new SafeMap(create("vitaminADose", "1").map())); assertFalse(didRuleApply); didRuleApply = rule.apply(new SafeMap(create("vitaminADose", "").map())); assertFalse(didRuleApply); }