object.addProperty("_ref", "/defect/1234");
createResult.add("Object", object);
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();
assertEquals(createdObj.get("_ref").getAsString(), "/defect/1234");
}