Hello,
I have developed my own Java framework for testing Flow services with JUnit. It is an abstraction over IData, so you can test the services using POJOs instead of handling IData yourself:
You can define your IS documents or Input/Output parameters as simple POJOs using public attributes or even Getters/Setters:
public class Address
{
private String street;
@PipelineName("CityName")
private String city;
[...]
}
The service is modeled as a simple Java class using lots of Reflection and Generics to minimize the needed code:
public class GetAddress extends Service<GetAddress.Input, GetAddress.Output>
{
public static class Input extends ServiceInput
{
public String id;
}
public static class Output extends ServiceOutput
{
public Address address;
}
}
A simple test may then look like this:
GetAddress sut = new GetAddress();
GetAddress.Input input = new GetAddress.Input();
GetAddress.Input.id = "123";
GetAddress.Output output = sut.call(input);
assertThat(output.address.getStreet(), is("My Street"));
Here’s an (older) blog post describing the functionality (before I extracted it as a framework): Unit-testing Flow Services in webMethods’ Integration Server with JUnit.
The framework is in use for almost two years now and is actively developed. The complete source code is on GitHub and it’s completely free, of course. Feel free to modify/add behaviour and send me a Pull Request.
I would love to get feedback on the framework! And please let me know, if I can be of further help to you.
Best regards,
Stefan
#webMethods-General#Integration-Server-and-ESB#webMethods