IsMotherClosedDueToDeathRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return DEATH_OF_MOTHER_VALUE.equalsIgnoreCase(reportFields.get(CLOSE_REASON_FIELD_NAME)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnTrueIfCloseReasonIsDeath() { SafeMap safeMap = new SafeMap(create("closeReason", "death_of_mother").map()); boolean didRuleApply = rule.apply(safeMap); assertTrue(didRuleApply); }
@Test public void shouldReturnFalseIfDeathReasonIsNotDeath() { boolean didRuleApply = rule.apply(new SafeMap(create("closeReason", "permanent_relocation").map())); assertFalse(didRuleApply); }