ShouldMotherBeReferredImmediatelyRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return reportFields.get(IMMEDIATE_REFERRAL).contains(AllConstants.Form.BOOLEAN_TRUE_VALUE); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnTrueIfMotherHasToBeRefferedImmediately() { SafeMap safeMap = new SafeMap(create("immediateReferral", "yes").map()); boolean didRuleApply = rule.apply(safeMap); assertTrue(didRuleApply); }
@Test public void shouldReturnFalseIfMotherDoesNotNeedToBeReferredImmediately() { boolean didRuleApply = rule.apply(new SafeMap(create("immediateReferral", "no").map())); assertFalse(didRuleApply); didRuleApply = rule.apply(new SafeMap(create("immediateReferral", "").map())); assertFalse(didRuleApply); }