IsSterilizationFailureRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return BOOLEAN_TRUE_VALUE.equalsIgnoreCase(reportFields.get(IS_STERILIZATION_FAILURE_FIELD_NAME)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenThereIsNoSterilizationFailure() { boolean didRuleSucceed = rule.apply(new SafeMap().put("isSterilizationFailure", null)); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("isSterilizationFailure", "")); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("isSterilizationFailure", "no")); assertFalse(didRuleSucceed); }
@Test public void shouldReturnTrueWhenThereIsSterilizationFailure() { boolean didRuleSucceed = rule.apply(new SafeMap().put("isSterilizationFailure", "yes")); assertTrue(didRuleSucceed); }