---
policy: /ce/unit-test/ends-with
logic: /ce/unit-test/ends-with/unit-test.logic.yaml
executionTime: 2026-01-03T12:03:49.95407718Z
generationMs: 79
executionMs: 578
rows:
  - id: Word-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: "unitTest(Word-1): not('abcklmxyz'.endsWith('abc'))"
      actual: "unitTest(Word-1): not('abcklmxyz'.endsWith('abc'))"
    runtimeError: {}
  - id: Word-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: "unitTest(Word-2): not('abcklmxyz'.endsWith('klm'))"
      actual: "unitTest(Word-2): not('abcklmxyz'.endsWith('klm'))"
    runtimeError: {}
  - id: Word-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: "unitTest(Word-3): 'abcklmxyz'.endsWith('xyz')"
      actual: "unitTest(Word-3): 'abcklmxyz'.endsWith('xyz')"
    runtimeError: {}
  - id: Word-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: "unitTest(Word-4): not('abcklmxyz'.endsWith('123'))"
      actual: "unitTest(Word-4): not('abcklmxyz'.endsWith('123'))"
    runtimeError: {}
  - id: Multiple-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 599
      actual: 599
    conditionText:
      expected: "unitTest(Multiple-1): not('abc klm xyz'.endsWith('abc'))"
      actual: "unitTest(Multiple-1): not('abc klm xyz'.endsWith('abc'))"
    runtimeError: {}
  - id: Multiple-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 699
      actual: 699
    conditionText:
      expected: "unitTest(Multiple-2): not('abc klm xyz'.endsWith('klm'))"
      actual: "unitTest(Multiple-2): not('abc klm xyz'.endsWith('klm'))"
    runtimeError: {}
  - id: Multiple-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 799
      actual: 799
    conditionText:
      expected: "unitTest(Multiple-3): 'abc klm xyz'.endsWith('xyz')"
      actual: "unitTest(Multiple-3): 'abc klm xyz'.endsWith('xyz')"
    runtimeError: {}
  - id: Multiple-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 899
      actual: 899
    conditionText:
      expected: "unitTest(Multiple-4): not('abc klm xyz'.endsWith('123'))"
      actual: "unitTest(Multiple-4): not('abc klm xyz'.endsWith('123'))"
    runtimeError: {}
  - id: Whitespace-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 999
      actual: 999
    conditionText:
      expected: "unitTest(Whitespace-1): ' aa   bb  cc '.endsWith('bb cc')"
      actual: "unitTest(Whitespace-1): ' aa   bb  cc '.endsWith('bb cc')"
    runtimeError: {}
  - id: Whitespace-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1099
      actual: 1099
    conditionText:
      expected: "unitTest(Whitespace-2): 'aa bb cc'.endsWith('  bb    cc ')"
      actual: "unitTest(Whitespace-2): 'aa bb cc'.endsWith('  bb    cc ')"
    runtimeError: {}
  - id: Whitespace-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1199
      actual: 1199
    conditionText:
      expected: "unitTest(Whitespace-3): ''.endsWith('\\n\\r\\t')"
      actual: "unitTest(Whitespace-3): ''.endsWith('\\n\\r\\t')"
    runtimeError: {}
  - id: Whitespace-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1299
      actual: 1299
    conditionText:
      expected: "unitTest(Whitespace-4): 'a b c'.endsWith('  a\\n b \\r c \\t')"
      actual: "unitTest(Whitespace-4): 'a b c'.endsWith('  a\\n b \\r c \\t')"
    runtimeError: {}
  - id: Case-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1399
      actual: 1399
    conditionText:
      expected: "unitTest(Case-1): 'ABC KLM XYZ'.endsWith('xyz')"
      actual: "unitTest(Case-1): 'ABC KLM XYZ'.endsWith('xyz')"
    runtimeError: {}
  - id: Null-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1499
      actual: 1499
    conditionText:
      expected: "unitTest(Null-1): null.endsWith(null)"
      actual: "unitTest(Null-1): null.endsWith(null)"
    runtimeError: {}
  - id: Null-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1599
      actual: 1599
    conditionText:
      expected: "unitTest(Null-2): ''.endsWith(null)"
      actual: "unitTest(Null-2): ''.endsWith(null)"
    runtimeError: {}
  - id: Null-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1699
      actual: 1699
    conditionText:
      expected: "unitTest(Null-3): 'abc'.endsWith(null)"
      actual: "unitTest(Null-3): 'abc'.endsWith(null)"
    runtimeError: {}
  - id: Null-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1799
      actual: 1799
    conditionText:
      expected: "unitTest(Null-4): null.endsWith('')"
      actual: "unitTest(Null-4): null.endsWith('')"
    runtimeError: {}
  - id: Null-5
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1899
      actual: 1899
    conditionText:
      expected: "unitTest(Null-5): not(null.endsWith('abc'))"
      actual: "unitTest(Null-5): not(null.endsWith('abc'))"
    runtimeError: {}
usedFiles:
  - path: /ce/unit-test/ends-with/policy.yaml
    md5Hash: 97E2801FAD3C39032E37A3E8E8610B59
    content: |-
      ---
      names:
        full: "ENDS_WITH Unit Tests"
        contextual: ENDS_WITH
      description: ""
  - path: /ce/unit-test/ends-with/unit-test.logic.yaml
    md5Hash: 0C79C5A4E4BAAEC5B8A1525857F4F6E8
    content: |-
      ---
      inputType: CA10__CaAwsInstance__c
      conditions:
        - status: COMPLIANT
          currentStateMessage: Word-1
          check:
            UNIT_TEST:
              id: Word-1
              expected:
                text: "unitTest(Word-1): not('abcklmxyz'.endsWith('abc'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        TEXT: "abcklmxyz"
                      search:
                        TEXT: "abc"
        - status: COMPLIANT
          currentStateMessage: Word-2
          check:
            UNIT_TEST:
              id: Word-2
              expected:
                text: "unitTest(Word-2): not('abcklmxyz'.endsWith('klm'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        TEXT: "abcklmxyz"
                      search:
                        TEXT: "klm"
        - status: COMPLIANT
          currentStateMessage: Word-3
          check:
            UNIT_TEST:
              id: Word-3
              expected:
                text: "unitTest(Word-3): 'abcklmxyz'.endsWith('xyz')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: "abcklmxyz"
                  search:
                    TEXT: "xyz"
        - status: COMPLIANT
          currentStateMessage: Word-4
          check:
            UNIT_TEST:
              id: Word-4
              expected:
                text: "unitTest(Word-4): not('abcklmxyz'.endsWith('123'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        TEXT: "abcklmxyz"
                      search:
                        TEXT: "123"
        - status: COMPLIANT
          currentStateMessage: Multiple-1
          check:
            UNIT_TEST:
              id: Multiple-1
              expected:
                text: "unitTest(Multiple-1): not('abc klm xyz'.endsWith('abc'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        TEXT: "abc klm xyz"
                      search:
                        TEXT: "abc"
        - status: COMPLIANT
          currentStateMessage: Multiple-2
          check:
            UNIT_TEST:
              id: Multiple-2
              expected:
                text: "unitTest(Multiple-2): not('abc klm xyz'.endsWith('klm'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        TEXT: "abc klm xyz"
                      search:
                        TEXT: "klm"
        - status: COMPLIANT
          currentStateMessage: Multiple-3
          check:
            UNIT_TEST:
              id: Multiple-3
              expected:
                text: "unitTest(Multiple-3): 'abc klm xyz'.endsWith('xyz')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: "abc klm xyz"
                  search:
                    TEXT: "xyz"
        - status: COMPLIANT
          currentStateMessage: Multiple-4
          check:
            UNIT_TEST:
              id: Multiple-4
              expected:
                text: "unitTest(Multiple-4): not('abc klm xyz'.endsWith('123'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        TEXT: "abc klm xyz"
                      search:
                        TEXT: "123"
        - status: COMPLIANT
          currentStateMessage: Whitespace-1
          check:
            UNIT_TEST:
              id: Whitespace-1
              expected:
                text: "unitTest(Whitespace-1): ' aa   bb  cc '.endsWith('bb cc')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: " aa   bb  cc "
                  search:
                    TEXT: "bb cc"
        - status: COMPLIANT
          currentStateMessage: Whitespace-2
          check:
            UNIT_TEST:
              id: Whitespace-2
              expected:
                text: "unitTest(Whitespace-2): 'aa bb cc'.endsWith('  bb    cc ')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: "aa bb cc"
                  search:
                    TEXT: "  bb    cc "
        - status: COMPLIANT
          currentStateMessage: Whitespace-3
          check:
            UNIT_TEST:
              id: Whitespace-3
              expected:
                text: "unitTest(Whitespace-3): ''.endsWith('\\n\\r\\t')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: ""
                  search:
                    TEXT: "\n\r\t"
        - status: COMPLIANT
          currentStateMessage: Whitespace-4
          check:
            UNIT_TEST:
              id: Whitespace-4
              expected:
                text: "unitTest(Whitespace-4): 'a b c'.endsWith('  a\\n b \\r c \\t')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: "a b c"
                  search:
                    TEXT: "  a\n b \r c \t"
        - status: COMPLIANT
          currentStateMessage: Case-1
          check:
            UNIT_TEST:
              id: Case-1
              expected:
                text: "unitTest(Case-1): 'ABC KLM XYZ'.endsWith('xyz')"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: "ABC KLM XYZ"
                  search:
                    TEXT: "xyz"
        - status: COMPLIANT
          currentStateMessage: Null-1
          check:
            UNIT_TEST:
              id: Null-1
              expected:
                text: "unitTest(Null-1): null.endsWith(null)"
              arg:
                ENDS_WITH:
                  arg:
                    UNIT_TEST_NULL:
                      returnType: TEXT
                  search:
                    UNIT_TEST_NULL:
                      returnType: TEXT
        - status: COMPLIANT
          currentStateMessage: Null-2
          check:
            UNIT_TEST:
              id: Null-2
              expected:
                text: "unitTest(Null-2): ''.endsWith(null)"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: ""
                  search:
                    UNIT_TEST_NULL:
                      returnType: TEXT
        - status: COMPLIANT
          currentStateMessage: Null-3
          check:
            UNIT_TEST:
              id: Null-3
              expected:
                text: "unitTest(Null-3): 'abc'.endsWith(null)"
              arg:
                ENDS_WITH:
                  arg:
                    TEXT: "abc"
                  search:
                    UNIT_TEST_NULL:
                      returnType: TEXT
        - status: COMPLIANT
          currentStateMessage: Null-4
          check:
            UNIT_TEST:
              id: Null-4
              expected:
                text: "unitTest(Null-4): null.endsWith('')"
              arg:
                ENDS_WITH:
                  arg:
                    UNIT_TEST_NULL:
                      returnType: TEXT
                  search:
                    TEXT: ""
        - status: COMPLIANT
          currentStateMessage: Null-5
          check:
            UNIT_TEST:
              id: Null-5
              expected:
                text: "unitTest(Null-5): not(null.endsWith('abc'))"
              arg:
                NOT:
                  arg:
                    ENDS_WITH:
                      arg:
                        UNIT_TEST_NULL:
                          returnType: TEXT
                      search:
                        TEXT: "abc"
      otherwise:
        status: INCOMPLIANT
        currentStateMessage: Test Failed
        remediationMessage: Developer Fix Required
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "Word-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 199,
      "conditionText" : "unitTest(Word-1): not('abcklmxyz'.endsWith('abc'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Word-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 299,
      "conditionText" : "unitTest(Word-2): not('abcklmxyz'.endsWith('klm'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Word-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 399,
      "conditionText" : "unitTest(Word-3): 'abcklmxyz'.endsWith('xyz')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Word-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 499,
      "conditionText" : "unitTest(Word-4): not('abcklmxyz'.endsWith('123'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 599,
      "conditionText" : "unitTest(Multiple-1): not('abc klm xyz'.endsWith('abc'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 699,
      "conditionText" : "unitTest(Multiple-2): not('abc klm xyz'.endsWith('klm'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 799,
      "conditionText" : "unitTest(Multiple-3): 'abc klm xyz'.endsWith('xyz')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 899,
      "conditionText" : "unitTest(Multiple-4): not('abc klm xyz'.endsWith('123'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 999,
      "conditionText" : "unitTest(Whitespace-1): ' aa   bb  cc '.endsWith('bb cc')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1099,
      "conditionText" : "unitTest(Whitespace-2): 'aa bb cc'.endsWith('  bb    cc ')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1199,
      "conditionText" : "unitTest(Whitespace-3): ''.endsWith('\\n\\r\\t')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1299,
      "conditionText" : "unitTest(Whitespace-4): 'a b c'.endsWith('  a\\n b \\r c \\t')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Case-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1399,
      "conditionText" : "unitTest(Case-1): 'ABC KLM XYZ'.endsWith('xyz')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1499,
      "conditionText" : "unitTest(Null-1): null.endsWith(null)",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1599,
      "conditionText" : "unitTest(Null-2): ''.endsWith(null)",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1699,
      "conditionText" : "unitTest(Null-3): 'abc'.endsWith(null)",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1799,
      "conditionText" : "unitTest(Null-4): null.endsWith('')",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-5",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1899,
      "conditionText" : "unitTest(Null-5): not(null.endsWith('abc'))",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsInstance__c()
  RETURNS ARRAY<STRUCT<
      CA10__disappearanceTime__c TIMESTAMP,
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Case-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-5"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaAwsInstance__c(
      obj STRUCT<
          CA10__disappearanceTime__c TIMESTAMP,
          Id STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
  var TextLib = new function () {
      this.normalize = function(arg) {
          return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
      };
      this.isEmpty = function(arg) {
          return this.normalize(arg) == '';
      };
      this.isNotEmpty = function(arg) {
          return this.normalize(arg) != '';
      };
      this.equal = function(left, right) {
          return this.normalize(left) == this.normalize(right);
      };
      this.notEqual = function(left, right) {
          return this.normalize(left) != this.normalize(right);
      };
      this.startsWith = function(arg, substring) {
          return this.normalize(arg).startsWith(this.normalize(substring));
      };
      this.endsWith = function(arg, substring) {
          return this.normalize(arg).endsWith(this.normalize(substring));
      };
      this.contains = function(arg, substring) {
          return this.normalize(arg).includes(this.normalize(substring));
      };
      this.containsAll = function(arg, substrings) {
          if (substrings == null || substrings.length === 0) return false;
          let normalizedArg = this.normalize(arg);
          return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
      };
      this.containsAny = function(arg, substrings) {
          if (substrings == null || substrings.length === 0) return false;
          let normalizedArg = this.normalize(arg);
          return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
      };
  }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      if (obj.Id == 'Word-1' && !TextLib.endsWith('abcklmxyz', 'abc')) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "unitTest(Word-1): not('abcklmxyz'.endsWith('abc'))", currentStateMessage: "Word-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      if (obj.Id == 'Word-2' && !TextLib.endsWith('abcklmxyz', 'klm')) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "unitTest(Word-2): not('abcklmxyz'.endsWith('klm'))", currentStateMessage: "Word-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[3], conditionIndex:[300..399]
      if (obj.Id == 'Word-3' && TextLib.endsWith('abcklmxyz', 'xyz')) {
          return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "unitTest(Word-3): 'abcklmxyz'.endsWith('xyz')", currentStateMessage: "Word-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[4], conditionIndex:[400..499]
      if (obj.Id == 'Word-4' && !TextLib.endsWith('abcklmxyz', '123')) {
          return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "unitTest(Word-4): not('abcklmxyz'.endsWith('123'))", currentStateMessage: "Word-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[5], conditionIndex:[500..599]
      if (obj.Id == 'Multiple-1' && !TextLib.endsWith('abc klm xyz', 'abc')) {
          return {status: 'COMPLIANT', conditionIndex: 599, conditionText: "unitTest(Multiple-1): not('abc klm xyz'.endsWith('abc'))", currentStateMessage: "Multiple-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[6], conditionIndex:[600..699]
      if (obj.Id == 'Multiple-2' && !TextLib.endsWith('abc klm xyz', 'klm')) {
          return {status: 'COMPLIANT', conditionIndex: 699, conditionText: "unitTest(Multiple-2): not('abc klm xyz'.endsWith('klm'))", currentStateMessage: "Multiple-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[7], conditionIndex:[700..799]
      if (obj.Id == 'Multiple-3' && TextLib.endsWith('abc klm xyz', 'xyz')) {
          return {status: 'COMPLIANT', conditionIndex: 799, conditionText: "unitTest(Multiple-3): 'abc klm xyz'.endsWith('xyz')", currentStateMessage: "Multiple-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[8], conditionIndex:[800..899]
      if (obj.Id == 'Multiple-4' && !TextLib.endsWith('abc klm xyz', '123')) {
          return {status: 'COMPLIANT', conditionIndex: 899, conditionText: "unitTest(Multiple-4): not('abc klm xyz'.endsWith('123'))", currentStateMessage: "Multiple-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[9], conditionIndex:[900..999]
      if (obj.Id == 'Whitespace-1' && TextLib.endsWith(' aa   bb  cc ', 'bb cc')) {
          return {status: 'COMPLIANT', conditionIndex: 999, conditionText: "unitTest(Whitespace-1): ' aa   bb  cc '.endsWith('bb cc')", currentStateMessage: "Whitespace-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[10], conditionIndex:[1000..1099]
      if (obj.Id == 'Whitespace-2' && TextLib.endsWith('aa bb cc', '  bb    cc ')) {
          return {status: 'COMPLIANT', conditionIndex: 1099, conditionText: "unitTest(Whitespace-2): 'aa bb cc'.endsWith('  bb    cc ')", currentStateMessage: "Whitespace-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[11], conditionIndex:[1100..1199]
      if (obj.Id == 'Whitespace-3' && TextLib.endsWith('', '\n\r\t')) {
          return {status: 'COMPLIANT', conditionIndex: 1199, conditionText: "unitTest(Whitespace-3): ''.endsWith('\\n\\r\\t')", currentStateMessage: "Whitespace-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[12], conditionIndex:[1200..1299]
      if (obj.Id == 'Whitespace-4' && TextLib.endsWith('a b c', '  a\n b \r c \t')) {
          return {status: 'COMPLIANT', conditionIndex: 1299, conditionText: "unitTest(Whitespace-4): 'a b c'.endsWith('  a\\n b \\r c \\t')", currentStateMessage: "Whitespace-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[13], conditionIndex:[1300..1399]
      if (obj.Id == 'Case-1' && TextLib.endsWith('ABC KLM XYZ', 'xyz')) {
          return {status: 'COMPLIANT', conditionIndex: 1399, conditionText: "unitTest(Case-1): 'ABC KLM XYZ'.endsWith('xyz')", currentStateMessage: "Case-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[14], conditionIndex:[1400..1499]
      if (obj.Id == 'Null-1' && TextLib.endsWith(null, null)) {
          return {status: 'COMPLIANT', conditionIndex: 1499, conditionText: "unitTest(Null-1): null.endsWith(null)", currentStateMessage: "Null-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[15], conditionIndex:[1500..1599]
      if (obj.Id == 'Null-2' && TextLib.endsWith('', null)) {
          return {status: 'COMPLIANT', conditionIndex: 1599, conditionText: "unitTest(Null-2): ''.endsWith(null)", currentStateMessage: "Null-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[16], conditionIndex:[1600..1699]
      if (obj.Id == 'Null-3' && TextLib.endsWith('abc', null)) {
          return {status: 'COMPLIANT', conditionIndex: 1699, conditionText: "unitTest(Null-3): 'abc'.endsWith(null)", currentStateMessage: "Null-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[17], conditionIndex:[1700..1799]
      if (obj.Id == 'Null-4' && TextLib.endsWith(null, '')) {
          return {status: 'COMPLIANT', conditionIndex: 1799, conditionText: "unitTest(Null-4): null.endsWith('')", currentStateMessage: "Null-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[18], conditionIndex:[1800..1899]
      if (obj.Id == 'Null-5' && !TextLib.endsWith(null, 'abc')) {
          return {status: 'COMPLIANT', conditionIndex: 1899, conditionText: "unitTest(Null-5): not(null.endsWith('abc'))", currentStateMessage: "Null-5", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 1900, conditionText: "otherwise", currentStateMessage: "Test Failed", currentStateReferences: references1.join('\n'), remediation: "Developer Fix Required", runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          sObject.Id AS Id,
          process_CA10__CaAwsInstance__c(
              STRUCT(
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                  sObject.Id AS Id
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaAwsInstance__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
