Я сейчас использую документы по весеннему отдыху и получаю следующую ошибку:
"org.springframework.restdocs.snippet.SnippetException: Cannot document response fields as the response body is empty"
И на самом деле, когда я отлаживал тест, я видел, что содержимое пустое. Это мой тест:
@Test
@Throws(Exception::class)
fun shouldReturnDefaultMessage() {
val paramsMock = mapOf("swid" to "asudyasd-asdasd-asdasd", "seeAll" to true)
`when`(apiRequest.parameters).thenReturn(paramsMock)
`when`(browsePlayerServiceRepresentable.getEntitiesBrowse(anyObject())).thenReturn(Single.just(presentBrowsePlayers()))
this.mockMvc!!.perform(get("/v1/browse/players").flashAttr("apiRequest", apiRequest)
.accept(MediaType.APPLICATION_JSON)
).andDo(document("home", preprocessRequest(),
preprocessResponse(prettyPrint()), relaxedResponseFields(
fieldWithPath("id")
.description("ID of the team."),
fieldWithPath("name")
.description("Name of the team."),
fieldWithPath("members")
.description("Empty list of team members.")
)))
}
Вот что я получаю от отладки:

Но я могу видеть информацию о моем посмешищенном ответе на модели и стороне обзора:

Мой метод контроллера возвращает один объект, как:

И по какой-то причине фреймворк не выполняет сопоставление должным образом, есть идеи, если возможно, можно установить эту информацию в ответ на контент или я могу создать настраиваемый FieldDescriptor, чтобы противостоять этому сценарию?
Спасибо