DeliveryIsAttendedByNonSBATrainedPersonRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return AllConstants.Form.BOOLEAN_FALSE_VALUE.equalsIgnoreCase(reportFields.get(IS_SKILLED_DELIVERY)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnTrueWhenDeliveryIsAttendedByNonSBATrainedPerson() throws Exception { boolean rulePassed = deliveryIsAttendedByNonSBATrainedPersonRule.apply(new SafeMap(mapOf("isSkilledDelivery", "no"))); assertTrue(rulePassed); }
@Test public void shouldReturnFalseWhenDeliveryIsNotAttendedByNonSBATrainedPerson() throws Exception { boolean rulePassed = deliveryIsAttendedByNonSBATrainedPersonRule.apply(new SafeMap(mapOf("isSkilledDelivery", "yes"))); assertFalse(rulePassed); rulePassed = deliveryIsAttendedByNonSBATrainedPersonRule.apply(new SafeMap(mapOf("isSkilledDelivery", ""))); assertFalse(rulePassed); }