MoreThanZeroECPsSuppliedRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return IntegerUtil.tryParse(reportFields.get(NUMBER_OF_ECPS_GIVEN_FIELD_NAME), 0) > 0; }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenNoECPsAreSupplied() throws Exception { assertFalse(rule.apply(new SafeMap().put("numberOfECPsGiven", null))); assertFalse(rule.apply(new SafeMap().put("numberOfECPsGiven", ""))); }
@Test public void shouldReturnFalseWhenZeroECPsAreSupplied() throws Exception { assertFalse(rule.apply(new SafeMap().put("numberOfECPsGiven", "0"))); }
@Test public void shouldReturnTrueWhenMoreThanZeroECPsAreSupplied() throws Exception { assertTrue(rule.apply(new SafeMap().put("numberOfECPsGiven", "1"))); }