π§ IS_EMPTY / NOT_EMPTY Unit Tests: JsonType - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/is-empty/json/unit-test.logic.yaml
- Located in: π IS_EMPTY / NOT_EMPTY Unit Tests: JsonType π’
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-05-10T12:06:23.997147688Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | Test-1 | βοΈ 199 | βοΈ unitTest(Test-1): {"name":"John","age":30}.isNotEmpty() | βοΈ null |
π’ | Test-2 | βοΈ 299 | βοΈ unitTest(Test-2): {"name":"John"}.isNotEmpty() | βοΈ null |
π’ | Test-3 | βοΈ 399 | βοΈ unitTest(Test-3): {"name":null}.isEmpty() | βοΈ null |
π’ | Test-4 | βοΈ 499 | βοΈ unitTest(Test-4): {}.isEmpty() | βοΈ null |
π’ | Test-5 | βοΈ 599 | βοΈ unitTest(Test-5): null.isEmpty() | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/is-empty/json/policy.yaml | 19C471AA9DC9E9419FC4703E8B9433AD |
Open | /ce/unit-test/is-empty/json/unit-test.logic.yaml | 29F2E64FDCD632C15FD48605132340B8 |
Open | /ce/unit-test/is-empty/json/test-data.json | 01C91A7A86F6F4F8FA7CE6F80B4B3766 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/is-empty/json/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/is-empty/json/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/is-empty/json/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/is-empty/json/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/is-empty/json/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:
NOT_EMPTY:
arg:
JSON: { name: "John", age: 30 }
- status: COMPLIANT
currentStateMessage: Test-2
check:
UNIT_TEST:
id: Test-2
arg:
NOT_EMPTY:
arg:
JSON: { name: "John"}
- status: COMPLIANT
currentStateMessage: Test-3
check:
UNIT_TEST:
id: Test-3
arg:
IS_EMPTY:
arg:
JSON: { name: null }
- status: COMPLIANT
currentStateMessage: Test-4
check:
UNIT_TEST:
id: Test-4
arg:
IS_EMPTY:
arg:
JSON: { }
- status: COMPLIANT
currentStateMessage: Test-5
check:
UNIT_TEST:
id: Test-5
arg:
IS_EMPTY:
arg:
UNIT_TEST_NULL:
returnType: TEXT
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required