@Test
public void shouldCreateTrajectoryWithoutUid() throws Exception {

    // build object
    ObjTrajectory traj = new ObjTrajectory();
    traj.setUid("");
    traj.setName("traj-a");
    traj.setUidWell("well-a");
    traj.setUidWellbore("wellbore-a");
    // get payload
    String payload = ((AbstractWitsmlObject) traj).getJSONString("1.4.1.1");
    // build http request
    String endpoint = this.url + this.trajectoryPath;
    HttpRequestWithBody req = Unirest.post(endpoint);
    req.header("Content-Type", "application/json");
    req.body(payload);
    req.queryString("uidWellbore", traj.getUidWellbore());
    req.queryString("uidWell", traj.getUidWell());
    // build http response mock
    HttpResponse<String> resp = mock(HttpResponse.class);
    when(resp.getBody()).thenReturn("{\"uid\": \"traj-a\"}");
    when(resp.getStatus()).thenReturn(200);
    // mock mockClient behavior
    when(this.mockClient.makeRequest(argThat(someReq -> (
        someReq.getHttpMethod().name().equals(req.getHttpMethod().name()) &&
        someReq.getUrl().equals(req.getUrl()) &&
        someReq.getHeaders().containsKey("Content-Type")
    )), eq("goodUsername"), eq("goodPassword"), anyString())).thenReturn(resp);
    // test
    String actualUid = this.delegator.createObject(traj, "goodUsername", "goodPassword", "exchangeID", this.mockClient);
    String expectedUid = "traj-a";
    assertEquals(expectedUid, actualUid);
}