Exploratory testing a Spring Boot app with WireMock Cloud
java
executable on your shell’s PATH
.
Clone the WireMock Cloud demo project and change the working directory to the newly checked out project:
src/main/resources/application.properties
changing the todo-api.baseurl
value to your mock API’s base URL noted earlier.
Run the app:
9000
.
GET
, URL /todo-items
, response Content-Type
header application/json
and the following JSON in the response body:
POST
to /todo-items
, response Content-Type
header application/json
and the following JSON in the response body:
GET /todo-items
stub you created at the start until you change it. However, if you visit the request log in the WireMock Cloud UI you can confirm that the request you expected actually arrived:
POST /todo-items
stub you created in the previous step and clone it (using the Clone button at the end of the form).
In the newly cloned stub, expand the Advanced section and give the stub a higher priority - 4 or less will work as the default is 5.
The reason we need to do this is to ensure that this and not the OK posting stub we cloned from is guaranteed to match an incoming POST /todo-items
.
In the response section change the response code to 502 and the message in the JSON body to something suitable: