use of com.yahoo.vespa.clustercontroller.utils.communication.http.HttpResult in project vespa by vespa-engine.
the class StateRestAPITest method retireAndExpectHttp400Response.
private String retireAndExpectHttp400Response(String condition, String responseWait) throws Exception {
JSONObject json = new JSONObject().put("state", new JSONObject().put("current", new JSONObject().put("state", "retired").put("reason", "No reason"))).put("condition", condition).put("response-wait", responseWait);
HttpResult result = execute(new HttpRequest().setPath("/cluster/v2/foo/3").setPostContent(json));
assertEquals(result.toString(true), 400, result.getHttpReturnCode());
assertEquals(result.toString(true), "application/json", result.getHeader("Content-Type"));
StringBuilder print = new StringBuilder();
result.printContent(print);
return print.toString();
}
Aggregations