CreateCDataSectionFunction implements Function { @Override public String execute(List<String> parameterList, TestContext context) { if (CollectionUtils.isEmpty(parameterList) || parameterList.size() != 1) { throw new InvalidFunctionUsageException("Invalid function parameter usage - missing parameter value!"); } return CDATA_START + parameterList.get(0) + CDATA_END; }  @Override String execute(List<String> parameterList, TestContext context);  }
@Test public void testFunction() { Assert.assertEquals(function.execute(Collections.singletonList(xmlFragment), context), resultXml); }
@Test(expectedExceptions = {InvalidFunctionUsageException.class}) public void testNoParameters() { function.execute(Collections.<String>emptyList(), context); }