Skip to main content

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

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“— AWS EC2 InstanceCA10__CaAwsInstance__c13255

Uses​

None

Test Results πŸŸ’β€‹

Generated at: 2025-09-13T12:10:13.132394868Z Open

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

FileMD5
Open/ce/unit-test/boolean-from/policy.yaml48668DF79ACE3DAA29FF2A355CDCDD4D
Open/ce/unit-test/boolean-from/unit-test.logic.yaml17F48E6E2468FB3CD3917DE32E1030E5

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​

Open File

---
inputType: CA10__CaAwsInstance__c
conditions:
- status: COMPLIANT
currentStateMessage: Test-1
check:
UNIT_TEST:
id: Test-1
expected:
text: "unitTest(Test-1): 'true'.asBoolean()"
arg:
BOOLEAN_FROM:
arg:
TEXT: "true"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-2
check:
UNIT_TEST:
id: Test-2
expected:
text: "unitTest(Test-2): 'TRUE'.asBoolean()"
arg:
BOOLEAN_FROM:
arg:
TEXT: "TRUE"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-3
check:
UNIT_TEST:
id: Test-3
expected:
text: "unitTest(Test-3): ' True '.asBoolean()"
arg:
BOOLEAN_FROM:
arg:
TEXT: " True "
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-4
check:
UNIT_TEST:
id: Test-4
expected:
text: "unitTest(Test-4): not('false'.asBoolean())"
arg:
NOT:
arg:
BOOLEAN_FROM:
arg:
TEXT: "false"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-5
check:
UNIT_TEST:
id: Test-5
expected:
text: "unitTest(Test-5): not('any-text'.asBoolean())"
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
expected:
status: UNDETERMINED
subIndex: 1
text: "''.isEmpty()"
arg:
BOOLEAN_FROM:
arg:
TEXT: ""
undeterminedIf:
isEmpty: "Empty text received"
- status: COMPLIANT
currentStateMessage: Test-7
check:
UNIT_TEST:
id: Test-7
expected:
status: UNDETERMINED
subIndex: 1
text: "null.isEmpty()"
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
expected:
status: UNDETERMINED
subIndex: 1
text: "''.isEmpty()"
arg:
BOOLEAN_FROM:
arg:
TEXT: ""
trueValue: ""
undeterminedIf:
isEmpty: "Empty text received"
- status: COMPLIANT
currentStateMessage: Test-9
check:
UNIT_TEST:
id: Test-9
expected:
text: "unitTest(Test-9): '1'.asBoolean('1')"
arg:
BOOLEAN_FROM:
arg:
TEXT: "1"
trueValue: "1"
undeterminedIf:
isEmpty: "Should not happen"
- status: COMPLIANT
currentStateMessage: Test-10
check:
UNIT_TEST:
id: Test-10
expected:
text: "unitTest(Test-10): not('Off'.asBoolean('On'))"
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
expected:
text: "unitTest(Test-11): 'ENABLED'.asBoolean('Enabled')"
arg:
BOOLEAN_FROM:
arg:
TEXT: "ENABLED"
trueValue: "Enabled"
undeterminedIf:
isEmpty: "Should not happen"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required