Skip to content

Consider request parameters when determining a GET request's query string #26

@Thorn1089

Description

@Thorn1089

I have a documentation test like the following:

@Test
public void testSearchingRoutes() throws Exception {
    mockMvc.perform(get("/routes").param("startNear", "+42.297877,-71.485591").param("endNear", "+41.949915,-71.406392"))
        .andExpect(status().isOk())
        .andDo(document("search-routes-example"));
}

When I run this as part of my Maven build, a request-response.asciidoc is produced, but the sample curl request omits the query parameters.

Putting a breakpoint in the RoutesController shows me that the parameters are indeed received by the controller, so I believe I'm sending them correctly with MockMvc.

Any reason I would get a curl snippet like:
[source,bash]
----
$ curl http://localhost:8080/routes -i
----
for this request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementEnhancement that adds a new feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions