Best Practices - wmaop/wm-jbehave GitHub Wiki
Testing fundamentals
Testing flow services should follow general rules of thumb:
- Think Unit when writing a scenario. You're testing just the flow service being invoked, not all the other services that it's calling. If you want to test at a component or functional level, consider using a tool such as Smartbear Ready!API
- Mock out all dependent service calls. Isolate the service under test and return fixed or variable responses from your mocks
- If you're finding it hard to write a test, lots of mocks then your service is probably doing too much. Think about refactoring it and considering Separation of Concerns and giving the service a Single Responsibility