-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hello!
Did you support WebTestClient?
Because I received an empty openapi-2.0.json:
{
"swagger" : "2.0",
"info" : {
"description" : "Description",
"version" : "0.0.1-SNAPSHOT",
"title" : "title"
},
"host" : "localhost:8080",
"tags" : [ ],
"schemes" : [ "http" ],
"paths" : { },
"definitions" : { }
}
With this test:
@Test
public void getEmployeeByName() throws Exception {
when(edManager.searchEmployees("John")).thenReturn(getEmployees(2));
webTestClient.get().uri("/api/employees?query={query}", "John")
.exchange()
.expectStatus().isOk()
.expectBodyList(Employee.class)
.consumeWith(document("employee/{method-name}",
requestParameters(parameterWithName("query").description("Employee name")),
responseFields(
fieldWithPath("[].aNumber").description("Employee's unique number"),
fieldWithPath("[].firstName").description("Employee's first name"),
fieldWithPath("[].lastName").description("Employee's lastName name"),
fieldWithPath("[].display").description("Employee's display"),
fieldWithPath("[].businessPhone").description("Employee's business phone"),
fieldWithPath("[].email").description("Employee's email"),
fieldWithPath("[].title").description("Employee's title"),
fieldWithPath("[].subscribedTo").description("Employee's subscriptions"),
fieldWithPath("[].groups").description("Employee's groups")
)));
}Thank you!
Metadata
Metadata
Assignees
Labels
No labels