Skip to content

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

Open
@silver-mx

Description

@silver-mx

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions