webMethods: OrgWmAop for mocking services

An ex-colleague in my organisation built some examples to mock services for use in junit testing. These use org.wmaop.state:enableInterception and org.wmaop.define.fixedResponse:registerFixedResponseMock. I’m assuming that these services create a “registration record” somewhere (I’m guessing the wM internal database) when the mock service is enabled, and refers to this when the “real” service is invoked to retrieve the specified output; and then is deleted on running org.wmaop.define.advice:removeAdvice. Can anyone advise me where I might find such a “registration record”, please

I suggest you use the OOTB feature WmTestSuite with mock services for this.

Thanks M@he$h, but that doesn’t answer my query! Our team has opted to use OrgWmAop, so I’m stuck with that for now. My question is whether it is possible to view the result of running the registerFixedResponseMock service, i.e. is the registration recorded in a database table somewhere?

Since this is a custom solution unless we see the code I cannot comment on anything.

We have used the service custom interceptor module and each time we register any service for interception or mocking it gets stored in the memory and we had to reload the same configs as part of startup activity. There is also an API to get the list of “getRegisteredServices”

Hope this will help you to some extent.

Hi Mahesh, thanks for the further response. Ah … I’d assumed the package OrgWmAOP was a standard wM package created by SoftwareAG - but from what you say that’s not the case. But it sounds like you’re saying that where you’ve used service interception elsewhere, the registration data is just held in memory. Thanks for this.

No, it’s not a standard package from the wM installation. But if it’s based on GitHub - wmaop/wm-aop: Mocking framework for webMethods Integration Server (the name seems similar), then you can inspect the code and find out the details.

I’ve looked at the project, and IMO it’s a very promising one. Better than WmTestSuite. If we hadn’t built a similar solution for our internal needs, I’d build a new one based on this project.