What guidance is available for writing service tests?

10 months ago by
New team members find it difficult to write service tests; partly because the concept may be unfamiliar but also because the usual advice to 'read the code' reveals inconsistent approaches with no clear preferred method. The company intranet is notably lacking in content on the subject. If there are any other documents that may help please make sure they are included here.

2 Answers

10 months ago by

This describes the use of a Factory pattern when creating the many sample objects required in service tests:

and here's a short presentation on the same subject:

10 months ago by
If your service test is for a feature that's currently in canary release you may have trouble in the endpoint resource when this checks for the corresponding feature toggle. To get round this, add a new method to your ResourceAdapter that takes the feature set id ("EXPERIMENTAL") as a parameter, then call a method in RequestUtils that adds a feature set header for that id. (If this method doesn't exist for the request type you'll have to add it. At the time of writing there's only one for POST.)

Note: Code is not yet merged so there's nothing to see!
Please login to add an answer/comment or follow this question.

Similar posts:
Search »