IsDeathDueToSevereHyperTensionOrFitsRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return HYPERTENSION_FITS_VALUE.equalsIgnoreCase(reportFields.get(MATERNAL_DEATH_CAUSE_FIELD_NAME)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenDeathIsNotDueToHyperTensionOrFits() { boolean didRuleSucceed = rule.apply(new SafeMap().put("maternalDeathCause", null)); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("maternalDeathCause", "")); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("maternalDeathCause", "fever_infection")); assertFalse(didRuleSucceed); }
@Test public void shouldReturnTrueWhenDeathIsDueToHyperTensionOrFits() { boolean didRuleSucceed = rule.apply(new SafeMap().put("maternalDeathCause", "hypertension_fits")); assertTrue(didRuleSucceed); }