We are implementing a REST API with Spring (4.1.1.). For certain HTTP requests, we would like to return a head with no body as a response. However, using ResponseEntit
Personally, to deal with empty responses, I use in my Integration Tests the MockMvcResponse object like this :
MockMvcResponse response = RestAssuredMockMvc.given()
.webAppContextSetup(webApplicationContext)
.when()
.get("/v1/ticket");
assertThat(response.mockHttpServletResponse().getStatus()).isEqualTo(HttpStatus.NO_CONTENT.value());
and in my controller I return empty response in a specific case like this :
return ResponseEntity.noContent().build();