IsMotherHasHemorrhageRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return StringUtils.contains(reportFields.get(VAGINAL_PROBLEMS_FIELD_NAME), HEAVY_BLEEDING_VALUE); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnTrueIfMotherHasHemorrhage() { SafeMap safeMap = new SafeMap(create("vaginalProblems", "heavy_bleeding bad_smell_lochea").map()); boolean didRuleApply = rule.apply(safeMap); assertTrue(didRuleApply); }
@Test public void shouldReturnFalseIfMotherDoesNotHaveHemorrhage() { boolean didRuleApply = rule.apply(new SafeMap(create("vaginalProblems", "bad_smell_lochea").map())); assertFalse(didRuleApply); }