Options to verify a Rest Providers (implemented in Integration Server), through WmTestSuite,
Case 1: Provider implementation drops all pipeline and pub.flow:setResponse is used instead as ‘XML data’.
Solution 1: WmTestSuite can invoke a REST provider/resource with “get” or “post” invoke type. It can then, validate the response XML either completely through file compare or through particular XPath.
Solution 2: Use ‘local REST client’, built with “pub.client:http” to invoke the REST resource (under test) and transform response bytes to IS document. Tests, then can be written for this wrapper client.
Example, Wrapper Client service named ‘RestClientXMLData’ is built with services, pub.client:http, pub.string:bytesToString, pub.xml: xmlStringToXMLNode, pub.xml: xmlNodeToDocument, which converts the response to document. Write Test for “RestClientXMLData” Service and pass the URL(of REST provider) and HTTPMethod as input arguments. The response of the client can be validated against pipeline data, just as regular tests.
Case 2: Provider implementation drops all pipeline and pub.flow:setResponse is used instead as ‘Json data’.
Solution 1: Solution #2, mentioned above has to be used here.
Example, Wrapper Client service named ‘RestClientJsonData’ is built with services, pub.client:http, pub.string:bytesToString, pub.json:jsonStringToDocument which converts the response to document. Write Test for “RestClientJsonData” Service and pass the URL(of REST provider) and HTTPMethod as input arguments. The response of the client can be validated against pipeline data as regular tests.
Verify Service Which does not return response Pipeline
WmTestSuite is an Unit Testing tool and expected to test the business logic only, which is written in IS. To override any scenarios where the output is getting dropped, or some async call is made to other endpoints, it is expected to design (empty) mocking during test, so that output is available and core business logic is tested. Could suggest some more exact solutions/reference points had the queried use case here around TN topic is more specific. WmTestSuite, as i know, is already in use for TN related scenarios at customer end.
#WmTestSuite-for-UI#webMethods-BPMS#webMethods