LocalHostAddressFunction implements Function { public String execute(List<String> parameterList, TestContext context) { if (!parameterList.isEmpty()) { throw new InvalidFunctionUsageException("Unexpected parameter for function."); } try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { throw new CitrusRuntimeException("Unable to locate local host address", e); } }  String execute(List<String> parameterList, TestContext context);  }
@Test public void testFunction() { Assert.assertNotNull(function.execute(Collections.<String>emptyList(), context)); }
@Test(expectedExceptions = {InvalidFunctionUsageException.class}) public void testNoParameters() { function.execute(Collections.<String>singletonList("foo"), context); }