Skip to content

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

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions