π§ LIST_FROM Unit Tests for Bytes Items - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/list-from/bytes-items/unit-test.logic.yaml
- Located in: π LIST_FROM Unit Tests for Bytes Items π’
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 | 53 |
Usesβ
None
Test Results π’β
Generated at: 2025-07-08T23:29:07.411405210Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | From-Null | βοΈ 199 | βοΈ unitTest(From-Null): null.asListOfBytes(',') == listOfBytes([]) | βοΈ null |
π’ | From-Empty | βοΈ 299 | βοΈ unitTest(From-Empty): bytes('').asListOfBytes(',') == listOfBytes(['']) | βοΈ null |
π’ | From-Whitespace | βοΈ 399 | βοΈ unitTest(From-Whitespace): bytes(' ').asListOfBytes(',') != listOfBytes(['']) | βοΈ null |
π’ | Single | βοΈ 499 | βοΈ unitTest(Single): bytes('a').asListOfBytes(',') == listOfBytes(['a']) | βοΈ null |
π’ | Single-Case | βοΈ 599 | βοΈ unitTest(Single-Case): bytes('A').asListOfBytes(',') != listOfBytes(['a']) | βοΈ null |
π’ | Single-Whitespaces | βοΈ 699 | βοΈ unitTest(Single-Whitespaces): bytes(' a ').asListOfBytes(',') != listOfBytes(['a']) | βοΈ null |
π’ | Empty-Values | βοΈ 799 | βοΈ unitTest(Empty-Values): bytes(',').asListOfBytes(',') == listOfBytes(['', '']) | βοΈ null |
π’ | Duplicate | βοΈ 899 | βοΈ unitTest(Duplicate): bytes('a,a').asListOfBytes(',') != listOfBytes(['a']) | βοΈ null |
π’ | Order | βοΈ 999 | βοΈ unitTest(Order): bytes('a,b').asListOfBytes(',') != listOfBytes(['b', 'a']) | βοΈ null |
π’ | Separator-NewLine | βοΈ 1099 | βοΈ unitTest(Separator-NewLine): bytes('line1\nline2\nline3\n').asListOfBytes('\n') == listOfBytes(['line1', 'line2', 'line3', '']) | βοΈ null |
π’ | Separator-Word | βοΈ 1199 | βοΈ unitTest(Separator-Word): bytes('banana').asListOfBytes('an') == listOfBytes(['b', '', 'a']) | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/list-from/bytes-items/policy.yaml | 02462A38E752BD326FAB12FFA32F2FFC |
Open | /ce/unit-test/list-from/bytes-items/unit-test.logic.yaml | AE800903B8B8DD7234DF2A42AEF43F91 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/list-from/bytes-items/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/list-from/bytes-items/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/list-from/bytes-items/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/list-from/bytes-items/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/list-from/bytes-items/unit-test.logic.yaml
Contentβ
---
inputType: CA10__CaAwsInstance__c
conditions:
- status: COMPLIANT
currentStateMessage: From-Null
check:
UNIT_TEST:
id: From-Null
expected:
text: "unitTest(From-Null): null.asListOfBytes(',') == listOfBytes([])"
arg:
IS_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
UNIT_TEST_NULL:
returnType: BYTES
right:
LIST:
itemType: BYTES
items: []
- status: COMPLIANT
currentStateMessage: From-Empty
check:
UNIT_TEST:
id: From-Empty
expected:
text: "unitTest(From-Empty): bytes('').asListOfBytes(',') == listOfBytes([''])"
arg:
IS_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: ""
right:
LIST:
itemType: BYTES
items:
- ""
- status: COMPLIANT
currentStateMessage: From-Whitespace
check:
UNIT_TEST:
id: From-Whitespace
expected:
text: "unitTest(From-Whitespace): bytes(' ').asListOfBytes(',') != listOfBytes([''])"
arg:
NOT_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: " "
right:
LIST:
itemType: BYTES
items:
- ""
- status: COMPLIANT
currentStateMessage: Single
check:
UNIT_TEST:
id: Single
expected:
text: "unitTest(Single): bytes('a').asListOfBytes(',') == listOfBytes(['a'])"
arg:
IS_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: "a"
right:
LIST:
itemType: BYTES
items:
- "a"
- status: COMPLIANT
currentStateMessage: Single-Case
check:
UNIT_TEST:
id: Single-Case
expected:
text: "unitTest(Single-Case): bytes('A').asListOfBytes(',') != listOfBytes(['a'])"
arg:
NOT_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: "A"
right:
LIST:
itemType: BYTES
items:
- "a"
- status: COMPLIANT
currentStateMessage: Single-Whitespaces
check:
UNIT_TEST:
id: Single-Whitespaces
expected:
text: "unitTest(Single-Whitespaces): bytes(' a ').asListOfBytes(',') != listOfBytes(['a'])"
arg:
NOT_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: " a "
right:
LIST:
itemType: BYTES
items:
- "a"
- status: COMPLIANT
currentStateMessage: Empty-Values
check:
UNIT_TEST:
id: Empty-Values
expected:
text: "unitTest(Empty-Values): bytes(',').asListOfBytes(',') == listOfBytes(['', ''])"
arg:
IS_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: ","
right:
LIST:
itemType: BYTES
items:
- ""
- ""
- status: COMPLIANT
currentStateMessage: Duplicate
check:
UNIT_TEST:
id: Duplicate
expected:
text: "unitTest(Duplicate): bytes('a,a').asListOfBytes(',') != listOfBytes(['a'])"
arg:
NOT_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: "a,a"
right:
LIST:
itemType: BYTES
items:
- "a"
- status: COMPLIANT
currentStateMessage: Order
check:
UNIT_TEST:
id: Order
expected:
text: "unitTest(Order): bytes('a,b').asListOfBytes(',') != listOfBytes(['b', 'a'])"
arg:
NOT_EQUAL:
left:
LIST_FROM:
separator: ","
arg:
BYTES: "a,b"
right:
LIST:
itemType: BYTES
items:
- "b"
- "a"
- status: COMPLIANT
currentStateMessage: Separator-NewLine
check:
UNIT_TEST:
id: Separator-NewLine
expected:
text: "unitTest(Separator-NewLine): bytes('line1\\nline2\\nline3\\n').asListOfBytes('\\n') == listOfBytes(['line1', 'line2', 'line3', ''])"
arg:
IS_EQUAL:
left:
LIST_FROM:
separator: "\n"
arg:
BYTES: "line1\nline2\nline3\n"
right:
LIST:
itemType: BYTES
items:
- "line1"
- "line2"
- "line3"
- ""
- status: COMPLIANT
currentStateMessage: Separator-Word
check:
UNIT_TEST:
id: Separator-Word
expected:
text: "unitTest(Separator-Word): bytes('banana').asListOfBytes('an') == listOfBytes(['b', '', 'a'])"
arg:
IS_EQUAL:
left:
LIST_FROM:
separator: "an"
arg:
BYTES: "banana"
right:
LIST:
itemType: BYTES
items:
- "b"
- ""
- "a"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required