π§ BOOLEAN_FROM Unit Tests - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/boolean-from/unit-test.logic.yaml
- Located in: π BOOLEAN_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:43.286139187Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | Test-1 | βοΈ 199 | βοΈ unitTest(Test-1): 'true'.asBoolean() | βοΈ null |
π’ | Test-2 | βοΈ 299 | βοΈ unitTest(Test-2): 'TRUE'.asBoolean() | βοΈ null |
π’ | Test-3 | βοΈ 399 | βοΈ unitTest(Test-3): ' True '.asBoolean() | βοΈ null |
π’ | Test-4 | βοΈ 499 | βοΈ unitTest(Test-4): not('false'.asBoolean()) | βοΈ null |
π’ | Test-5 | βοΈ 599 | βοΈ unitTest(Test-5): not('any-text'.asBoolean()) | βοΈ null |
π’ | Test-6 | βοΈ 601 | βοΈ ''.isEmpty() | βοΈ null |
π’ | Test-7 | βοΈ 701 | βοΈ null.isEmpty() | βοΈ null |
π’ | Test-8 | βοΈ 801 | βοΈ ''.isEmpty() | βοΈ null |
π’ | Test-9 | βοΈ 999 | βοΈ unitTest(Test-9): '1'.asBoolean('1') | βοΈ null |
π’ | Test-10 | βοΈ 1099 | βοΈ unitTest(Test-10): not('Off'.asBoolean('On')) | βοΈ null |
π’ | Test-11 | βοΈ 1199 | βοΈ unitTest(Test-11): 'ENABLED'.asBoolean('Enabled') | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/boolean-from/policy.yaml | 48668DF79ACE3DAA29FF2A355CDCDD4D |
Open | /ce/unit-test/boolean-from/unit-test.logic.yaml | D7D56066D3455BC231B822DB01C4678E |
Open | /ce/unit-test/boolean-from/test-data.json | 7CC92B0EF1BE01464CE3F7EF3E4DF88E |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/boolean-from/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/boolean-from/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/boolean-from/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/boolean-from/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/boolean-from/unit-test.logic.yaml
Contentβ
---
inputType: CA10__CaAwsInstance__c
testData:
- file: test-data.json
conditions:
- status: COMPLIANT
currentStateMessage: Test-1
check:
UNIT_TEST:
id: Test-1
arg:
BOOLEAN_FROM:
arg:
TEXT: "true"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-2
check:
UNIT_TEST:
id: Test-2
arg:
BOOLEAN_FROM:
arg:
TEXT: "TRUE"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-3
check:
UNIT_TEST:
id: Test-3
arg:
BOOLEAN_FROM:
arg:
TEXT: " True "
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-4
check:
UNIT_TEST:
id: Test-4
arg:
NOT:
arg:
BOOLEAN_FROM:
arg:
TEXT: "false"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-5
check:
UNIT_TEST:
id: Test-5
arg:
NOT:
arg:
BOOLEAN_FROM:
arg:
TEXT: "any-text"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-6
check:
UNIT_TEST:
id: Test-6
arg:
BOOLEAN_FROM:
arg:
TEXT: ""
undeterminedIf:
isEmpty: "Empty text received"
- status: COMPLIANT
currentStateMessage: Test-7
check:
UNIT_TEST:
id: Test-7
arg:
BOOLEAN_FROM:
arg:
UNIT_TEST_NULL:
returnType: TEXT
undeterminedIf:
isEmpty: "Empty text received"
- status: COMPLIANT
currentStateMessage: Test-8
check:
UNIT_TEST:
id: Test-8
arg:
BOOLEAN_FROM:
arg:
TEXT: ""
trueValue: ""
undeterminedIf:
isEmpty: "Empty text received"
- status: COMPLIANT
currentStateMessage: Test-9
check:
UNIT_TEST:
id: Test-9
arg:
BOOLEAN_FROM:
arg:
TEXT: "1"
trueValue: "1"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-10
check:
UNIT_TEST:
id: Test-10
arg:
NOT:
arg:
BOOLEAN_FROM:
arg:
TEXT: "Off"
trueValue: "On"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-11
check:
UNIT_TEST:
id: Test-11
arg:
BOOLEAN_FROM:
arg:
TEXT: "ENABLED"
trueValue: "Enabled"
undeterminedIf:
isEmpty: "Should not happen"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required