wmaop / wm-jbehave

Unit Testing for webMethods Flow services with a Behavioural Driven style
https://github.com/wmaop/wm-jbehave/wiki
MIT License
5 stars 3 forks source link

Cached services prevent expected behaviour when called by a story #9

Open sysgen opened 7 years ago

sysgen commented 7 years ago

If a service is called from a 'when invoke' and it has caching enabled, this can lead to misunderstanding when it returns cached values instead of the expected mocks that it might be calling.

Cached services called within a service do not experience this problem and are correctly mocked, it only affects a service invoked from the story.

It may be possible to trigger the resetting of the cache value by intercepting the service invoke from the session that's invoking the test. Debugging has shown the service is intercepted. Careful consideration required how to implement so as not to introduce overhead for all non-intercepts.