JsonObject newDefect = new JsonObject();
newDefect.addProperty("Name", "Foo");
CreateRequest request = new CreateRequest("defect", newDefect);
doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), request.getBody());
CreateResponse createResponse = api.create(request);
verify(api.client).doPost(request.toUrl(), request.getBody());
Assert.assertTrue(createResponse.wasSuccessful());
JsonObject createdObj = createResponse.getObject();