CurrentFPMethodIsEitherMaleOrFemaleSterilizationRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return FEMALE_STERILIZATION_FP_METHOD_VALUE.equalsIgnoreCase(reportFields.get(CURRENT_FP_METHOD_FIELD_NAME)) || MALE_STERILIZATION_FP_METHOD_VALUE.equalsIgnoreCase(reportFields.get(CURRENT_FP_METHOD_FIELD_NAME)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenCurrentFPMethodOfECIsNeitherMaleNorFemaleSterilization() { boolean didRuleSucceed = rule.apply(new SafeMap().put("currentMethod", "ocp")); assertFalse(didRuleSucceed); }
@Test public void shouldReturnTrueIfCurrentFPMethodOfTheECIsEitherMaleOrFemaleSterilization() { boolean didRuleSucceed = rule.apply(new SafeMap().put("currentMethod", "female_sterilization")); assertTrue(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("currentMethod", "male_sterilization")); assertTrue(didRuleSucceed); }