IsDeathCausedByImmunizationRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return BOOLEAN_TRUE_VALUE.equalsIgnoreCase(reportFields.get(IS_IMMUNIZATION_DEATH)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenDeathIsNotDueToImmunization() { boolean didRuleSucceed = rule.apply(new SafeMap().put("isImmunizationDeath", null)); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("isImmunizationDeath", "")); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("isImmunizationDeath", "no")); assertFalse(didRuleSucceed); }
@Test public void shouldReturnTrueWhenDeathIsDueToImmunization() { boolean didRuleSucceed = rule.apply(new SafeMap().put("isImmunizationDeath", "yes")); assertTrue(didRuleSucceed); }