@Test
public void shouldCreateLog1411() throws Exception {

    // get the raw WITSML XML request from resource file
    String rawXML = TestUtilities.getResourceAsString("log1411.xml");
    // handle version 1.4.1.1; it is not necessary to test 1.3.1.1
    com.hashmapinc.tempus.WitsmlObjects.v1411.ObjLogs logs = WitsmlMarshal.deserialize(
            rawXML, com.hashmapinc.tempus.WitsmlObjects.v1411.ObjLogs.class);
    // for testing, there is only 1 log under test, so obtain that one
    com.hashmapinc.tempus.WitsmlObjects.v1411.ObjLog log = logs.getLog().get(0);
    // ********************************* ChannelSet ********************************* //
    ChannelSet channelSet = ChannelSet.from1411(log);
    String csPayload = channelSet.toJson();
    // build first http request that creates a ChannelSet
    // endpoint:
    // .../channelSets?uid={uid}&uidWellbore={uidWellbore}&uidWell={uidWell}
    String endpointCS = this.url + this.logChannelsetPath;  // endpoint must match with
    // the one used in DotDelegator
    // (logChannelsetPath)
    HttpRequestWithBody requestCS = Unirest.post(endpointCS);
    // add query string params for ChannelSet creation:
    //      uid, uidWellbore, and uidWell
    requestCS.queryString("uid", log.getUid());
    requestCS.queryString("uidWellbore", log.getUidWellbore());
    requestCS.queryString("uidWell", log.getUidWell());
    // create the header for create ChannelSet
    requestCS.header("Content-Type", "application/json");
    // create the payload for create ChannelSet
    requestCS.body(csPayload);
    // build http response mock for ChannelSet
    HttpResponse<String> respCS = mock(HttpResponse.class);
    // only requires the uid and uuid from ChannelSet
    when(respCS.getBody()).thenReturn(  "{\"uid\": \""
            + log.getUid() + "\"," + "\"uuid\": \"testUUID\"}" );
    when(respCS.getStatus()).thenReturn(201);
    // ********************************** Channels ********************************** //
    String channelsPayload  = Channel.channelListToJson(Channel.from1411(log));
    // build second http request that creates Channels for the ChannelSet
    // endpoint:
    // .../channels/metadata?channelSetUuid={channelSetUuid}
    String endpointCH = this.url + this.logChannelsPath;    // endpoint must match with
    // the one used in DotDelegator
    // (logChannelsPath)
    HttpRequestWithBody requestCHs = Unirest.post(endpointCH);
    // add query string params for Channels creation:
    //      channelSetUuid
    requestCHs.queryString("channelSetUuid", "testUUID");
    // create the header for create Channels
    requestCHs.header("Content-Type", "application/json");
    // create the payload for create Channels
    requestCHs.body(channelsPayload);
    // build http response mock for Channels
    HttpResponse<String> respCHs = mock(HttpResponse.class);
    when(respCHs.getStatus()).thenReturn(200);
    // ************************************ Data ************************************ //
    String dataPayload  = DotLogDataHelper.convertDataToDotFrom1411(log);
    // build third http request that creates data for the channel set
    // endpoint: .../channels/data?channelSetUuid={channelSetUuid}
    String endpointData =  this.url + this.logDataPath;     // endpoint must match with
    // the one used in DotDelegator
    // (logDataPath)
    HttpRequestWithBody requestData = Unirest.post(endpointData);
    // add query string params for data creation:
    //      channelSetUuid
    requestData.queryString("channelSetUuid", "testUUID");
    // create the header for Data creation:
    requestData.header("Content-Type", "application/json");
    // create the payload for create data
    requestData.body(dataPayload);
    // build http response mock for Data
    HttpResponse<String> respData = mock(HttpResponse.class);
    when(respData.getBody()).thenReturn(  "{\"uid\": \""
            + log.getUid() + "\"," + "\"uuid\": \"testUUID\"}" );
    when(respData.getStatus()).thenReturn(200);
    // *********************************** Mocking ********************************** //
    when(this.mockClient.makeRequest(any(HttpRequest.class), anyString(), anyString(), anyString()))
            .thenAnswer(
                    invocation -> {
                        HttpRequest req = invocation.getArgument(0);
                        String userName = invocation.getArgument(1);
                        String pass = invocation.getArgument(2);
                        if (req.getHttpMethod().name().equals(requestCS.getHttpMethod().name()) &&
                                req.getUrl().equals(requestCS.getUrl()) &&
                                req.getHeaders().containsKey("Content-Type") &&
                                userName.equals("goodUsername") &&
                                pass.equals("goodPassword")) {
                            return respCS;
                        } else if (req.getHttpMethod().name().equals(requestCHs.getHttpMethod().name()) &&
                                req.getUrl().equals(requestCHs.getUrl()) &&
                                req.getHeaders().containsKey("Content-Type") &&
                                userName.equals("goodUsername") &&
                                pass.equals("goodPassword")) {
                            return respCHs;
                        } else if (req.getHttpMethod().name().equals(requestData.getHttpMethod().name()) &&
                                req.getUrl().equals(requestData.getUrl()) &&
                                req.getHeaders().containsKey("Content-Type") &&
                                userName.equals("goodUsername") &&
                                pass.equals("goodPassword")) {
                            return respData;
                        } else {
                            throw new InvalidUseOfMatchersException(
                                    String.format("Argument %s does not match", req.getUrl()));
                        }
                    });
    // ********************************* Validation ********************************* //
    String actualUid = this.delegator.createObject( log,
            "goodUsername",
            "goodPassword",
            "exchangeID",
            this.mockClient );
    String expectedUid = log.getUid();
    assertEquals(expectedUid, actualUid);
}