wiremock / wiremock.org

WireMock website, powered by Jekyll. Contributions are welcome!
https://wiremock.org/
MIT License
11 stars 49 forks source link

The example given in "Using WireMock with Spring Boot" has an error #240

Open silver-mx opened 10 months ago

silver-mx commented 10 months ago

Page

_docs/solutions/spring-boot.md

Details

The example given in "Using WireMock with Spring Boot" has an extra stubFor() and it causes a compiling error (and some confusion). It should be:

        wiremock.stubFor(get("/todolist").willReturn(aResponse()
                .withHeader("Content-Type", "application/json")
                .withBody("""
                        [
                            { "id": 1, "userId": 1, "title": "my todo" },
                        ]
                        """)
        ));

instead of:

 wiremock.stubFor(stubFor(get("/todolist").willReturn(aResponse()
                .withHeader("Content-Type", "application/json")
                .withBody("""
                        [
                            { "id": 1, "userId": 1, "title": "my todo" },
                        ]
                        """)
        )));

Suggested Edits

Remove the extra stubFor().

References

No response