--- policy: /ce/unit-test/greater-than logic: /ce/unit-test/greater-than/unit-test.logic.yaml executionTime: 2026-03-28T12:07:40.096682997Z generationMs: 63 executionMs: 2000 rows: - id: Simple-1 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: "unitTest(Simple-1): not(number(0.0) > number(1.0))" actual: "unitTest(Simple-1): not(number(0.0) > number(1.0))" runtimeError: {} - id: Simple-2 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 299 actual: 299 conditionText: expected: "unitTest(Simple-2): number(1.0) > number(0.0)" actual: "unitTest(Simple-2): number(1.0) > number(0.0)" runtimeError: {} - id: Simple-3 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 399 actual: 399 conditionText: expected: "unitTest(Simple-3): not(number(1.0) > number(1.0))" actual: "unitTest(Simple-3): not(number(1.0) > number(1.0))" runtimeError: {} - id: Simple-4 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 499 actual: 499 conditionText: expected: "unitTest(Simple-4): number(1.0000000001) > number(1.0)" actual: "unitTest(Simple-4): number(1.0000000001) > number(1.0)" runtimeError: {} - id: Precision-1 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 599 actual: 599 conditionText: expected: "unitTest(Precision-1): number(1.111111111222224E9) > number(1.111111111222223E9)" actual: "unitTest(Precision-1): number(1.111111111222224E9) > number(1.111111111222223E9)" runtimeError: {} - id: Precision-2 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 699 actual: 699 conditionText: expected: "unitTest(Precision-2): number(1.1111111112222235E9) > number(1.1111111112222233E9)" actual: "unitTest(Precision-2): number(1.1111111112222235E9) > number(1.1111111112222233E9)" runtimeError: {} - id: Precision-3 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 799 actual: 799 conditionText: expected: "unitTest(Precision-3): not(number(1.1111111112222235E9) > number(1.1111111112222235E9))" actual: "unitTest(Precision-3): not(number(1.1111111112222235E9) > number(1.1111111112222235E9))" runtimeError: {} - id: Null-1 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 899 actual: 899 conditionText: expected: "unitTest(Null-1): not(null > null)" actual: "unitTest(Null-1): not(null > null)" runtimeError: {} - id: Null-2 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 999 actual: 999 conditionText: expected: "unitTest(Null-2): not(number(-1.0) > null)" actual: "unitTest(Null-2): not(number(-1.0) > null)" runtimeError: {} - id: Null-3 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 1099 actual: 1099 conditionText: expected: "unitTest(Null-3): not(number(1.0) > null)" actual: "unitTest(Null-3): not(number(1.0) > null)" runtimeError: {} - id: Null-4 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 1199 actual: 1199 conditionText: expected: "unitTest(Null-4): not(null > number(-1.0))" actual: "unitTest(Null-4): not(null > number(-1.0))" runtimeError: {} - id: Null-5 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 1299 actual: 1299 conditionText: expected: "unitTest(Null-5): not(null > number(1.0))" actual: "unitTest(Null-5): not(null > number(1.0))" runtimeError: {} - id: Duration-1 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 1399 actual: 1399 conditionText: expected: "unitTest(Duration-1): 'PT1M' > 'PT1S'" actual: "unitTest(Duration-1): 'PT1M' > 'PT1S'" runtimeError: {} - id: Duration-2 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 1499 actual: 1499 conditionText: expected: "unitTest(Duration-2): '1m'.asDuration() > 'PT1S'" actual: "unitTest(Duration-2): '1m'.asDuration() > 'PT1S'" runtimeError: {} usedFiles: - path: /ce/unit-test/greater-than/policy.yaml md5Hash: 7889920B2D568280282D97C31621EEAB content: | --- names: full: GREATER_THAN Unit Tests contextual: GREATER_THAN description: "Unit tests for GREATER_THAN operation" - path: /ce/unit-test/greater-than/unit-test.logic.yaml md5Hash: 721015362BCE38734B1DEDDB92299802 content: |- --- inputType: CA10__CaAwsInstance__c conditions: - status: COMPLIANT currentStateMessage: Simple-1 check: UNIT_TEST: id: Simple-1 expected: text: "unitTest(Simple-1): not(number(0.0) > number(1.0))" arg: NOT: arg: GREATER_THAN: left: NUMBER: 0 right: NUMBER: 1 - status: COMPLIANT currentStateMessage: Simple-2 check: UNIT_TEST: id: Simple-2 expected: text: "unitTest(Simple-2): number(1.0) > number(0.0)" arg: GREATER_THAN: left: NUMBER: 1 right: NUMBER: 0 - status: COMPLIANT currentStateMessage: Simple-3 check: UNIT_TEST: id: Simple-3 expected: text: "unitTest(Simple-3): not(number(1.0) > number(1.0))" arg: NOT: arg: GREATER_THAN: left: NUMBER: 1 right: NUMBER: 1 - status: COMPLIANT currentStateMessage: Simple-4 check: UNIT_TEST: id: Simple-4 expected: text: "unitTest(Simple-4): number(1.0000000001) > number(1.0)" arg: GREATER_THAN: left: NUMBER: 1.0000000001 right: NUMBER: 1 - status: COMPLIANT currentStateMessage: Precision-1 check: UNIT_TEST: id: Precision-1 expected: text: "unitTest(Precision-1): number(1.111111111222224E9) > number(1.111111111222223E9)" arg: GREATER_THAN: left: NUMBER: 1111111111.222224 right: NUMBER: 1111111111.222223 - status: COMPLIANT currentStateMessage: Precision-2 check: UNIT_TEST: id: Precision-2 expected: text: "unitTest(Precision-2): number(1.1111111112222235E9) > number(1.1111111112222233E9)" arg: GREATER_THAN: left: NUMBER: 1111111111.2222235 right: NUMBER: 1111111111.2222234 - status: COMPLIANT currentStateMessage: Precision-3 check: UNIT_TEST: id: Precision-3 expected: text: "unitTest(Precision-3): not(number(1.1111111112222235E9) > number(1.1111111112222235E9))" arg: NOT: arg: GREATER_THAN: left: NUMBER: 1111111111.22222346 right: NUMBER: 1111111111.22222345 - status: COMPLIANT currentStateMessage: Null-1 check: UNIT_TEST: id: Null-1 expected: text: "unitTest(Null-1): not(null > null)" arg: NOT: arg: GREATER_THAN: left: UNIT_TEST_NULL: returnType: NUMBER right: UNIT_TEST_NULL: returnType: NUMBER - status: COMPLIANT currentStateMessage: Null-2 check: UNIT_TEST: id: Null-2 expected: text: "unitTest(Null-2): not(number(-1.0) > null)" arg: NOT: arg: GREATER_THAN: left: NUMBER: -1 right: UNIT_TEST_NULL: returnType: NUMBER - status: COMPLIANT currentStateMessage: Null-3 check: UNIT_TEST: id: Null-3 expected: text: "unitTest(Null-3): not(number(1.0) > null)" arg: NOT: arg: GREATER_THAN: left: NUMBER: 1 right: UNIT_TEST_NULL: returnType: NUMBER - status: COMPLIANT currentStateMessage: Null-4 check: UNIT_TEST: id: Null-4 expected: text: "unitTest(Null-4): not(null > number(-1.0))" arg: NOT: arg: GREATER_THAN: left: UNIT_TEST_NULL: returnType: NUMBER right: NUMBER: -1 - status: COMPLIANT currentStateMessage: Null-5 check: UNIT_TEST: id: Null-5 expected: text: "unitTest(Null-5): not(null > number(1.0))" arg: NOT: arg: GREATER_THAN: left: UNIT_TEST_NULL: returnType: NUMBER right: NUMBER: 1 - status: COMPLIANT currentStateMessage: Duration-1 check: UNIT_TEST: id: Duration-1 expected: text: "unitTest(Duration-1): 'PT1M' > 'PT1S'" arg: GREATER_THAN: left: DURATION: "PT1M" right: DURATION: "PT1S" - status: COMPLIANT currentStateMessage: Duration-2 check: UNIT_TEST: id: Duration-2 expected: text: "unitTest(Duration-2): '1m'.asDuration() > 'PT1S'" arg: GREATER_THAN: left: DURATION_FROM: arg: TEXT: "1m" format: GCP undeterminedIf: isEmpty: "Should not happen" invalidFormat: "Should not happen" right: DURATION: "PT1S" otherwise: status: INCOMPLIANT currentStateMessage: Test Failed remediationMessage: Developer Fix Required script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "Simple-1", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 199, "conditionText" : "unitTest(Simple-1): not(number(0.0) > number(1.0))", "runtimeError" : null } }, { "Id" : "Simple-2", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 299, "conditionText" : "unitTest(Simple-2): number(1.0) > number(0.0)", "runtimeError" : null } }, { "Id" : "Simple-3", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 399, "conditionText" : "unitTest(Simple-3): not(number(1.0) > number(1.0))", "runtimeError" : null } }, { "Id" : "Simple-4", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 499, "conditionText" : "unitTest(Simple-4): number(1.0000000001) > number(1.0)", "runtimeError" : null } }, { "Id" : "Precision-1", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 599, "conditionText" : "unitTest(Precision-1): number(1.111111111222224E9) > number(1.111111111222223E9)", "runtimeError" : null } }, { "Id" : "Precision-2", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 699, "conditionText" : "unitTest(Precision-2): number(1.1111111112222235E9) > number(1.1111111112222233E9)", "runtimeError" : null } }, { "Id" : "Precision-3", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 799, "conditionText" : "unitTest(Precision-3): not(number(1.1111111112222235E9) > number(1.1111111112222235E9))", "runtimeError" : null } }, { "Id" : "Null-1", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 899, "conditionText" : "unitTest(Null-1): not(null > null)", "runtimeError" : null } }, { "Id" : "Null-2", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 999, "conditionText" : "unitTest(Null-2): not(number(-1.0) > null)", "runtimeError" : null } }, { "Id" : "Null-3", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 1099, "conditionText" : "unitTest(Null-3): not(number(1.0) > null)", "runtimeError" : null } }, { "Id" : "Null-4", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 1199, "conditionText" : "unitTest(Null-4): not(null > number(-1.0))", "runtimeError" : null } }, { "Id" : "Null-5", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 1299, "conditionText" : "unitTest(Null-5): not(null > number(1.0))", "runtimeError" : null } }, { "Id" : "Duration-1", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 1399, "conditionText" : "unitTest(Duration-1): 'PT1M' > 'PT1S'", "runtimeError" : null } }, { "Id" : "Duration-2", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : 1499, "conditionText" : "unitTest(Duration-2): '1m'.asDuration() > 'PT1S'", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAwsInstance__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Simple-1" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Simple-2" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Simple-3" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Simple-4" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Precision-1" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Precision-2" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Precision-3" }, { "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" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Duration-1" }, { "context" : { "snapshotTime" : new Date("2024-01-01T00:00:00.000Z") }, "Id" : "Duration-2" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAwsInstance__c( obj STRUCT< CA10__disappearanceTime__c TIMESTAMP, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" var DurationLib = new function () { var googleFormatRegex = /(?^\d+)(?[smhd])/; var iso8601DurationRegex = /^P(?:(?\d+)Y)?(?:(?\d+)M)?(?:(?\d+)D)?(?:T(?:(?\d+)H)?(?:(?\d+)M)?(?:(?\d+(?:\.\d+)?)S)?)?$/; this.parseGoogleFormat = function(arg) { var parsed = arg.toLowerCase().match(googleFormatRegex); if (parsed == null || parsed.groups == null || parsed.groups.duration == null || parsed.groups.unit == null) { throw new Error("Invalid duration value: " + arg + ". Must match: \d+[smhd]"); } else { var durationValue = parseFloat(parsed.groups.duration); var multiplier; switch (parsed.groups.unit) { case ('s'): multiplier = 1; break; case ('m'): multiplier = 60; break; case ('h'): multiplier = 60*60; break; case ('d'): multiplier = 60*60*24; break; } return durationValue*multiplier; } }; this.checkGoogleFormat = function(arg) { return arg != null && googleFormatRegex.test(arg); }; this.parseIso8601Format = function(arg) { var parsed = arg.match(iso8601DurationRegex); if (parsed == null || parsed.groups == null) { throw new Error("Invalid duration value: " + arg + ". Must match ISO 8601 duration format."); } else { var out = 0; if (parsed.groups.years) { // simpliest way for normalizing - it's calculate month as 30 days in year and months convertings, otherwise P1Y != P12M out += parseFloat(parsed.groups.years) * 60*60*24*30*12; } if (parsed.groups.months) { out += parseFloat(parsed.groups.months) * 60*60*24*30; } if (parsed.groups.days) { out += parseFloat(parsed.groups.days) * 60*60*24; } if (parsed.groups.hours) { out += parseFloat(parsed.groups.hours) * 60*60; } if (parsed.groups.minutes) { out += parseFloat(parsed.groups.minutes) * 60; } if (parsed.groups.seconds) { out += parseFloat(parsed.groups.seconds); } return out; } } this.checkIso8601Format = function(arg) { return arg != null && iso8601DurationRegex.test(arg); }; this.isEmpty = function(arg) { return arg == null || arg.trim() == ''; }; }(); 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 == 'Simple-1' && !(0.0 != null && 1.0 != null && 0.0 > 1.0)) { return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "unitTest(Simple-1): not(number(0.0) > number(1.0))", currentStateMessage: "Simple-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[2], conditionIndex:[200..299] if (obj.Id == 'Simple-2' && (1.0 != null && 0.0 != null && 1.0 > 0.0)) { return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "unitTest(Simple-2): number(1.0) > number(0.0)", currentStateMessage: "Simple-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[3], conditionIndex:[300..399] if (obj.Id == 'Simple-3' && !(1.0 != null && 1.0 != null && 1.0 > 1.0)) { return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "unitTest(Simple-3): not(number(1.0) > number(1.0))", currentStateMessage: "Simple-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[4], conditionIndex:[400..499] if (obj.Id == 'Simple-4' && (1.0000000001 != null && 1.0 != null && 1.0000000001 > 1.0)) { return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "unitTest(Simple-4): number(1.0000000001) > number(1.0)", currentStateMessage: "Simple-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[5], conditionIndex:[500..599] if (obj.Id == 'Precision-1' && (1.111111111222224E9 != null && 1.111111111222223E9 != null && 1.111111111222224E9 > 1.111111111222223E9)) { return {status: 'COMPLIANT', conditionIndex: 599, conditionText: "unitTest(Precision-1): number(1.111111111222224E9) > number(1.111111111222223E9)", currentStateMessage: "Precision-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[6], conditionIndex:[600..699] if (obj.Id == 'Precision-2' && (1.1111111112222235E9 != null && 1.1111111112222233E9 != null && 1.1111111112222235E9 > 1.1111111112222233E9)) { return {status: 'COMPLIANT', conditionIndex: 699, conditionText: "unitTest(Precision-2): number(1.1111111112222235E9) > number(1.1111111112222233E9)", currentStateMessage: "Precision-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[7], conditionIndex:[700..799] if (obj.Id == 'Precision-3' && !(1.1111111112222235E9 != null && 1.1111111112222235E9 != null && 1.1111111112222235E9 > 1.1111111112222235E9)) { return {status: 'COMPLIANT', conditionIndex: 799, conditionText: "unitTest(Precision-3): not(number(1.1111111112222235E9) > number(1.1111111112222235E9))", currentStateMessage: "Precision-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[8], conditionIndex:[800..899] if (obj.Id == 'Null-1' && !(null != null && null != null && null > null)) { return {status: 'COMPLIANT', conditionIndex: 899, conditionText: "unitTest(Null-1): not(null > null)", currentStateMessage: "Null-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[9], conditionIndex:[900..999] if (obj.Id == 'Null-2' && !(-1.0 != null && null != null && -1.0 > null)) { return {status: 'COMPLIANT', conditionIndex: 999, conditionText: "unitTest(Null-2): not(number(-1.0) > null)", currentStateMessage: "Null-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[10], conditionIndex:[1000..1099] if (obj.Id == 'Null-3' && !(1.0 != null && null != null && 1.0 > null)) { return {status: 'COMPLIANT', conditionIndex: 1099, conditionText: "unitTest(Null-3): not(number(1.0) > null)", currentStateMessage: "Null-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[11], conditionIndex:[1100..1199] if (obj.Id == 'Null-4' && !(null != null && -1.0 != null && null > -1.0)) { return {status: 'COMPLIANT', conditionIndex: 1199, conditionText: "unitTest(Null-4): not(null > number(-1.0))", currentStateMessage: "Null-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[12], conditionIndex:[1200..1299] if (obj.Id == 'Null-5' && !(null != null && 1.0 != null && null > 1.0)) { return {status: 'COMPLIANT', conditionIndex: 1299, conditionText: "unitTest(Null-5): not(null > number(1.0))", currentStateMessage: "Null-5", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[13], conditionIndex:[1300..1399] function comparison14() { var comparisonLeft17 = DurationLib.parseIso8601Format('PT1M'); var comparisonRight18 = DurationLib.parseIso8601Format('PT1S'); return comparisonLeft17 != null && comparisonRight18 != null && comparisonLeft17 > comparisonRight18; } try { if (obj.Id == 'Duration-1' && comparison14()) { return {status: 'COMPLIANT', conditionIndex: 1399, conditionText: "unitTest(Duration-1): 'PT1M' > 'PT1S'", currentStateMessage: "Duration-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[14], conditionIndex:[1400..1499] function comparison19() { var comparisonLeft23 = durationChecked20(); var comparisonRight24 = DurationLib.parseIso8601Format('PT1S'); return comparisonLeft23 != null && comparisonRight24 != null && comparisonLeft23 > comparisonRight24; } function durationChecked20() { var durationFrom21 = '1m'; if (DurationLib.isEmpty(durationFrom21)) { throw new Error("UNDETERMINED condition:1401", {cause: {status: 'UNDETERMINED', conditionIndex: 1401, conditionText: "'1m'.isEmpty()", currentStateMessage: "Should not happen", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (!DurationLib.checkGoogleFormat(durationFrom21)) { throw new Error("UNDETERMINED condition:1402", {cause: {status: 'UNDETERMINED', conditionIndex: 1402, conditionText: "'1m'.checkFormat('GCP')", currentStateMessage: "Should not happen", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return DurationLib.parseGoogleFormat(durationFrom21); } try { if (obj.Id == 'Duration-2' && comparison19()) { return {status: 'COMPLIANT', conditionIndex: 1499, conditionText: "unitTest(Duration-2): '1m'.asDuration() > 'PT1S'", currentStateMessage: "Duration-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } return {status: 'INCOMPLIANT', conditionIndex: 1500, 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;