use of org.sonar.api.server.ws.RequestHandler in project sonarqube by SonarSource.
the class WebServiceEngineTest method test_response_with_no_content.
@Test
public void test_response_with_no_content() {
Request request = new TestRequest().setPath("api/foo");
RequestHandler handler = (req, resp) -> resp.noContent();
DumbResponse response = run(request, newWs("api/foo", a -> a.setHandler(handler)));
assertThat(response.stream().outputAsString()).isEmpty();
assertThat(response.status()).isEqualTo(204);
}
Aggregations