IsURLFunction implements DDMExpressionFunction.Function1<Object, Boolean> { @Override public Boolean apply(Object parameter) { if (parameter == null) { return false; } return Validator.isUrl(parameter.toString()); }  @Override Boolean apply(Object parameter); @Override String getName(); static final String NAME; }
@Test public void testInvalidURL() { IsURLFunction isURLFunction = new IsURLFunction(); Boolean result = isURLFunction.apply("invalid URL"); Assert.assertFalse(result); }
@Test public void testNullParameter() { IsURLFunction isURLFunction = new IsURLFunction(); Boolean result = isURLFunction.apply(null); Assert.assertFalse(result); }
@Test public void testValidURL() { IsURLFunction isURLFunction = new IsURLFunction(); Boolean result = isURLFunction.apply("http: Assert.assertTrue(result); }