π§ ENDS_WITH Unit Tests - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/ends-with/unit-test.logic.yaml
- Located in: π ENDS_WITH 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:48.390466607Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | Word-1 | βοΈ 199 | βοΈ unitTest(Word-1): not('abcklmxyz'.endsWith('abc')) | βοΈ null |
π’ | Word-2 | βοΈ 299 | βοΈ unitTest(Word-2): not('abcklmxyz'.endsWith('klm')) | βοΈ null |
π’ | Word-3 | βοΈ 399 | βοΈ unitTest(Word-3): 'abcklmxyz'.endsWith('xyz') | βοΈ null |
π’ | Word-4 | βοΈ 499 | βοΈ unitTest(Word-4): not('abcklmxyz'.endsWith('123')) | βοΈ null |
π’ | Multiple-1 | βοΈ 599 | βοΈ unitTest(Multiple-1): not('abc klm xyz'.endsWith('abc')) | βοΈ null |
π’ | Multiple-2 | βοΈ 699 | βοΈ unitTest(Multiple-2): not('abc klm xyz'.endsWith('klm')) | βοΈ null |
π’ | Multiple-3 | βοΈ 799 | βοΈ unitTest(Multiple-3): 'abc klm xyz'.endsWith('xyz') | βοΈ null |
π’ | Multiple-4 | βοΈ 899 | βοΈ unitTest(Multiple-4): not('abc klm xyz'.endsWith('123')) | βοΈ null |
π’ | Whitespace-1 | βοΈ 999 | βοΈ unitTest(Whitespace-1): ' aa bb cc '.endsWith('bb cc') | βοΈ null |
π’ | Whitespace-2 | βοΈ 1099 | βοΈ unitTest(Whitespace-2): 'aa bb cc'.endsWith(' bb cc ') | βοΈ null |
π’ | Whitespace-3 | βοΈ 1199 | βοΈ unitTest(Whitespace-3): ''.endsWith('\n\r\t') | βοΈ null |
π’ | Whitespace-4 | βοΈ 1299 | βοΈ unitTest(Whitespace-4): 'a b c'.endsWith(' a\n b \r c \t') | βοΈ null |
π’ | Case-1 | βοΈ 1399 | βοΈ unitTest(Case-1): 'ABC KLM XYZ'.endsWith('xyz') | βοΈ null |
π’ | Null-1 | βοΈ 1499 | βοΈ unitTest(Null-1): null.endsWith(null) | βοΈ null |
π’ | Null-2 | βοΈ 1599 | βοΈ unitTest(Null-2): ''.endsWith(null) | βοΈ null |
π’ | Null-3 | βοΈ 1699 | βοΈ unitTest(Null-3): 'abc'.endsWith(null) | βοΈ null |
π’ | Null-4 | βοΈ 1799 | βοΈ unitTest(Null-4): null.endsWith('') | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/ends-with/policy.yaml | 97E2801FAD3C39032E37A3E8E8610B59 |
Open | /ce/unit-test/ends-with/unit-test.logic.yaml | 17CEFF9A49E0F5D94AD9440B79829A91 |
Open | /ce/unit-test/ends-with/test-data.json | 0A3939021DDE52BADE8838F8019C6AF8 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/ends-with/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/ends-with/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/ends-with/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/ends-with/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/ends-with/unit-test.logic.yaml
Contentβ
---
inputType: CA10__CaAwsInstance__c
testData:
- file: test-data.json
conditions:
- status: COMPLIANT
currentStateMessage: Word-1
check:
UNIT_TEST:
id: Word-1
arg:
NOT:
arg:
ENDS_WITH:
arg:
TEXT: "abcklmxyz"
suffix:
TEXT: "abc"
- status: COMPLIANT
currentStateMessage: Word-2
check:
UNIT_TEST:
id: Word-2
arg:
NOT:
arg:
ENDS_WITH:
arg:
TEXT: "abcklmxyz"
suffix:
TEXT: "klm"
- status: COMPLIANT
currentStateMessage: Word-3
check:
UNIT_TEST:
id: Word-3
arg:
ENDS_WITH:
arg:
TEXT: "abcklmxyz"
suffix:
TEXT: "xyz"
- status: COMPLIANT
currentStateMessage: Word-4
check:
UNIT_TEST:
id: Word-4
arg:
NOT:
arg:
ENDS_WITH:
arg:
TEXT: "abcklmxyz"
suffix:
TEXT: "123"
- status: COMPLIANT
currentStateMessage: Multiple-1
check:
UNIT_TEST:
id: Multiple-1
arg:
NOT:
arg:
ENDS_WITH:
arg:
TEXT: "abc klm xyz"
suffix:
TEXT: "abc"
- status: COMPLIANT
currentStateMessage: Multiple-2
check:
UNIT_TEST:
id: Multiple-2
arg:
NOT:
arg:
ENDS_WITH:
arg:
TEXT: "abc klm xyz"
suffix:
TEXT: "klm"
- status: COMPLIANT
currentStateMessage: Multiple-3
check:
UNIT_TEST:
id: Multiple-3
arg:
ENDS_WITH:
arg:
TEXT: "abc klm xyz"
suffix:
TEXT: "xyz"
- status: COMPLIANT
currentStateMessage: Multiple-4
check:
UNIT_TEST:
id: Multiple-4
arg:
NOT:
arg:
ENDS_WITH:
arg:
TEXT: "abc klm xyz"
suffix:
TEXT: "123"
- status: COMPLIANT
currentStateMessage: Whitespace-1
check:
UNIT_TEST:
id: Whitespace-1
arg:
ENDS_WITH:
arg:
TEXT: " aa bb cc "
suffix:
TEXT: "bb cc"
- status: COMPLIANT
currentStateMessage: Whitespace-2
check:
UNIT_TEST:
id: Whitespace-2
arg:
ENDS_WITH:
arg:
TEXT: "aa bb cc"
suffix:
TEXT: " bb cc "
- status: COMPLIANT
currentStateMessage: Whitespace-3
check:
UNIT_TEST:
id: Whitespace-3
arg:
ENDS_WITH:
arg:
TEXT: ""
suffix:
TEXT: "\n\r\t"
- status: COMPLIANT
currentStateMessage: Whitespace-4
check:
UNIT_TEST:
id: Whitespace-4
arg:
ENDS_WITH:
arg:
TEXT: "a b c"
suffix:
TEXT: " a\n b \r c \t"
- status: COMPLIANT
currentStateMessage: Case-1
check:
UNIT_TEST:
id: Case-1
arg:
ENDS_WITH:
arg:
TEXT: "ABC KLM XYZ"
suffix:
TEXT: "xyz"
- status: COMPLIANT
currentStateMessage: Null-1
check:
UNIT_TEST:
id: Null-1
arg:
ENDS_WITH:
arg:
UNIT_TEST_NULL:
returnType: TEXT
suffix:
UNIT_TEST_NULL:
returnType: TEXT
- status: COMPLIANT
currentStateMessage: Null-2
check:
UNIT_TEST:
id: Null-2
arg:
ENDS_WITH:
arg:
TEXT: ""
suffix:
UNIT_TEST_NULL:
returnType: TEXT
- status: COMPLIANT
currentStateMessage: Null-3
check:
UNIT_TEST:
id: Null-3
arg:
ENDS_WITH:
arg:
TEXT: "abc"
suffix:
UNIT_TEST_NULL:
returnType: TEXT
- status: COMPLIANT
currentStateMessage: Null-4
check:
UNIT_TEST:
id: Null-4
arg:
ENDS_WITH:
arg:
UNIT_TEST_NULL:
returnType: TEXT
suffix:
TEXT: ""
- status: COMPLIANT
currentStateMessage: Null-5
check:
UNIT_TEST:
id: Null-5
arg:
NOT:
arg:
ENDS_WITH:
arg:
UNIT_TEST_NULL:
returnType: TEXT
suffix:
TEXT: "abc"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required