webMethods 10.2 | Unit Test Framework | Mocks | Mocks beyond Unit Testing
 
Mocks beyond Unit Testing
Although Test Suite added the ability to mock service calls in Integration Server for unit testing, the feature is so powerful that its use cannot be limited to unit testing alone. One common case is to use the mocking capability to provide flow service instrumentation.
Using the wm.ps.serviceMock:loadMock service in the WmServiceMock package, any service can be mocked with an alternate service or class. The new service or Java class code can invoke any operations and then invoke the original mocked service. The mocking framework is intelligent enough to detect recursion and, as such, provides an instrumentation capability.
Mocks can be used to design test cases. A service being tested can also itself be mocked with other code. In such a scenario, the mocked test service can be replaced with other code that can execute pre and post-test operations. This can provide some basic functional testing capabilities for Test Suite.

Copyright © 2017-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release