Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12350

Camel Salesforce Component Test fails

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.20.2
    • None
    • camel-salesforce
    • None
    • Unknown

    Description

      Current code fails when we run

      mvn install

      .

      Here is the error which it give.

      Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 0.212 s <<< FAILURE! - in org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest
      shouldSerializeToJson(org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest)  Time elapsed: 0.078 s  <<< FAILURE!
      org.junit.ComparisonFailure: 
      [Should serialize as expected by Salesforce] expected:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]]
      }"> but was:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]
      ]
      }">
      	at org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest.shouldSerializeToJson(SObjectCompositeTest.java:117)
      
      shouldSerializeToJson(org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest)  Time elapsed: 0.082 s  <<< FAILURE!
      org.junit.ComparisonFailure: 
      [Should serialize as expected by Salesforce] expected:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]]
      }"> but was:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]
      ]
      }">
      	at org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest.shouldSerializeToJson(SObjectCompositeTest.java:117)
      
      shouldSerializeToJson(org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest)  Time elapsed: 0.038 s  <<< FAILURE!
      org.junit.ComparisonFailure: 
      [Should serialize as expected by Salesforce] expected:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]]
      }"> but was:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]
      ]
      }">
      	at org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest.shouldSerializeToJson(SObjectCompositeTest.java:117)
      
      Running org.apache.camel.component.salesforce.api.dto.composite.SObjectNodeTest
      Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.085 s - in org.apache.camel.component.salesforce.api.dto.composite.SObjectNodeTest
      Running org.apache.camel.component.salesforce.api.dto.composite.SObjectTreeResponseTest
      Security framework of XStream not initialized, XStream is probably vulnerable.
      Security framework of XStream not initialized, XStream is probably vulnerable.
      Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 s - in org.apache.camel.component.salesforce.api.dto.composite.SObjectTreeResponseTest
      Running org.apache.camel.component.salesforce.api.dto.composite.SObjectTreeTest
      Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.071 s - in org.apache.camel.component.salesforce.api.dto.composite.SObjectTreeTest
      Running org.apache.camel.component.salesforce.api.utils.DateTimeUtilsTest
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.038 s - in org.apache.camel.component.salesforce.api.utils.DateTimeUtilsTest
      Running org.apache.camel.component.salesforce.api.utils.JsonUtilsTest
      Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.648 s - in org.apache.camel.component.salesforce.api.utils.JsonUtilsTest
      Running org.apache.camel.component.salesforce.api.utils.VersionTest
      Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.camel.component.salesforce.api.utils.VersionTest
      Running org.apache.camel.component.salesforce.internal.LoginTokenTest
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.camel.component.salesforce.internal.LoginTokenTest
      Running org.apache.camel.component.salesforce.internal.SalesforceSessionTest
      Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.145 s - in org.apache.camel.component.salesforce.internal.SalesforceSessionTest
      Running org.apache.camel.component.salesforce.internal.client.AbstractClientBaseTest
      Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.56 s - in org.apache.camel.component.salesforce.internal.client.AbstractClientBaseTest
      Running org.apache.camel.component.salesforce.internal.client.DefaultCompositeApiClientTest
      Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 s - in org.apache.camel.component.salesforce.internal.client.DefaultCompositeApiClientTest
      Running org.apache.camel.component.salesforce.internal.processor.AbstractRestProcessorApprovalTest
      Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.283 s - in org.apache.camel.component.salesforce.internal.processor.AbstractRestProcessorApprovalTest
      Running org.apache.camel.component.salesforce.internal.processor.JsonRestProcessorTest
      Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 s - in org.apache.camel.component.salesforce.internal.processor.JsonRestProcessorTest
      Running org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelperTest
      Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.741 s - in org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelperTest
      
      Results:
      
      Failures: 
      org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest.shouldSerializeToJson(org.apache.camel.component.salesforce.api.dto.composite.SObjectCompositeTest)
        Run 1: SObjectCompositeTest.shouldSerializeToJson:117 [Should serialize as expected by Salesforce] expected:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]]
      }"> but was:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]
      ]
      }">
        Run 2: SObjectCompositeTest.shouldSerializeToJson:117 [Should serialize as expected by Salesforce] expected:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]]
      }"> but was:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]
      ]
      }">
        Run 3: SObjectCompositeTest.shouldSerializeToJson:117 [Should serialize as expected by Salesforce] expected:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]]
      }"> but was:<"{[
        "allOrNone" : true,
        "compositeRequest" : [ {
          "method" : "PATCH",
          "url" : "/services/data/v38.0/sobjects/Account/001xx000003DIpcAAG",
          "referenceId" : "UpdatedAccount",
          "body" : {
            "Name" : "Salesforce",
            "BillingStreet" : "Landmark @ 1 Market Street",
            "BillingCity" : "San Francisco",
            "BillingState" : "California",
            "Industry" : "Technology"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/Contact/",
          "referenceId" : "NewContact",
          "body" : {
            "LastName" : "John Doe",
            "Phone" : "1234567890"
          }
        }, {
          "method" : "POST",
          "url" : "/services/data/v38.0/sobjects/null/",
          "referenceId" : "JunctionRecord",
          "body" : {
            "account__c" : "001xx000003DIpcAAG",
            "contactId__c" : "@{NewContact.id}"
          }
        } ]
      ]
      }">
      
      
      Tests run: 146, Failures: 1, Errors: 0, Skipped: 0
      
      ------------------------------------------------------------------------
      BUILD FAILURE
      ------------------------------------------------------------------------
      Total time: 02:01 min
      Finished at: 2018-03-14T14:24:37+05:30
      Final Memory: 27M/88M
      ------------------------------------------------------------------------
      Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project camel-salesforce: There are test failures.
      
      Please refer to C:\h\client\teliasonera\git\camel\components\camel-salesforce\camel-salesforce-component\target\surefire-reports for the individual test results.
      Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
      -> [Help 1]
      
      To see the full stack trace of the errors, re-run Maven with the -e switch.
      Re-run Maven using the -X switch to enable full debug logging.
      
      For more information about the errors and possible solutions, please read the following articles:
      [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
      
      

      Attachments

        Activity

          People

            zregvart Zoran Regvart
            hemangajmera Hemang Ajmera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: