Skip to main content

🧠 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​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS EC2 InstanceCA10__CaAwsInstance__c12244

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:47:46.650539933Z Open

ResultIdCondition IndexCondition TextRuntime 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​

FileMD5
Open/ce/unit-test/date-time-from/policy.yamlB82427E3B62E9981434C44298F5A3F9C
Open/ce/unit-test/date-time-from/unit-test.logic.yaml0D96CA667276069855B4C5FA74382C1F
Open/ce/unit-test/date-time-from/test-data.json58B93A4BAFAA08349B627CA73D86F04B

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​

Open File

---
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