String body = "Some error";
DummyServer server = new DummyServer(port);
// Construct and configure a canned response for the server to return
ResponseModel cannedResponse = new ResponseModel();
cannedResponse.setStatusCode(400); // status code: 400
cannedResponse.setBody(body); // body: "Some error"
// Make a new POST Request.
Request manualRequest = new Request(config, null, HttpMethod.POST); // construct the Request
manualRequest.setBody(body); // set the request body to send to the server
manualRequest.clearAsynchronous(); // make this request synchronously so that the test is blocked