π§ DATE_TIME_FROM Unit Tests - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/date-time-from/unit-test.logic.yaml
- Located in: π DATE_TIME_FROM Unit Tests π’
Flagsβ
- π’ Logic test success
- π’ Logic with test data
- π’ Unit-test logic
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS EC2 Instance | CA10__CaAwsInstance__c | 12 | 2 | 44 |
Usesβ
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:47:46.650539933Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | Valid-ISO-8601 | βοΈ 199 | βοΈ unitTest(Valid-ISO-8601): '2024-10-27T14:30:00Z'.asDateTime() == '2024-10-27T14:30:00Z' | βοΈ null |
π’ | Valid-Timezone-Offset | βοΈ 299 | βοΈ unitTest(Valid-Timezone-Offset): '2024-10-27T10:00:00-05:00'.asDateTime() == '2024-10-27T15:00:00Z' | βοΈ null |
π’ | Valid-Date-Only | βοΈ 399 | βοΈ unitTest(Valid-Date-Only): '2024-10-27'.asDateTime() == '2024-10-27T00:00:00Z' | βοΈ null |
π’ | Valid-Milliseconds | βοΈ 499 | βοΈ unitTest(Valid-Milliseconds): '2024-10-27T14:30:00.123Z'.asDateTime() == '2024-10-27T14:30:00.123Z' | βοΈ null |
π’ | Null-Value-Empty-String | βοΈ 501 | βοΈ ''.isEmpty() | βοΈ null |
π’ | Null-Value-Custom | βοΈ 601 | βοΈ 'N/A'.isEmpty() | βοΈ null |
π’ | Null-Value-Null-Input | βοΈ 701 | βοΈ null.isEmpty() | βοΈ null |
π’ | Null-Value-Empty-Whitespace | βοΈ 801 | βοΈ ' '.isEmpty() | βοΈ null |
π’ | Invalid-Format | βοΈ 902 | βοΈ 'invalid date'.checkIso8601() | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/date-time-from/policy.yaml | B82427E3B62E9981434C44298F5A3F9C |
Open | /ce/unit-test/date-time-from/unit-test.logic.yaml | 0D96CA667276069855B4C5FA74382C1F |
Open | /ce/unit-test/date-time-from/test-data.json | 58B93A4BAFAA08349B627CA73D86F04B |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/date-time-from/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/date-time-from/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/date-time-from/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/date-time-from/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/date-time-from/unit-test.logic.yaml
Contentβ
---
inputType: CA10__CaAwsInstance__c
testData:
- file: test-data.json
conditions:
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 date and time"
check:
UNIT_TEST:
id: Valid-ISO-8601
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27T14:30:00Z"
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T14:30:00Z"
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 with timezone offset"
check:
UNIT_TEST:
id: Valid-Timezone-Offset
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27T10:00:00-05:00" # 10:00 AM EST = 3:00 PM UTC
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T15:00:00Z" # Expected result in UTC
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 date only"
check:
UNIT_TEST:
id: Valid-Date-Only
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27"
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T00:00:00Z"
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 with milliseconds"
check:
UNIT_TEST:
id: Valid-Milliseconds
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27T14:30:00.123Z"
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T14:30:00.123Z"
- status: COMPLIANT
currentStateMessage: "Null value handling (empty string)"
check:
UNIT_TEST:
id: Null-Value-Empty-String
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: ""
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (custom null value)"
check:
UNIT_TEST:
id: Null-Value-Custom
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: "N/A"
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (null input)"
check:
UNIT_TEST:
id: Null-Value-Null-Input
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
UNIT_TEST_NULL:
returnType: TEXT
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (whitespace string)"
check:
UNIT_TEST:
id: Null-Value-Empty-Whitespace
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: " "
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Invalid format - Undetermined"
check:
UNIT_TEST:
id: Invalid-Format
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "invalid date"
format: "ISO_8601"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2000-01-01T00:00:00Z"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required