π§ GREATER_THAN Unit Tests - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/greater-than/unit-test.logic.yaml
- Located in: π GREATER_THAN 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:49.762473419Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | Simple-1 | βοΈ 199 | βοΈ unitTest(Simple-1): not(number(0.0) > number(1.0)) | βοΈ null |
π’ | Simple-2 | βοΈ 299 | βοΈ unitTest(Simple-2): number(1.0) > number(0.0) | βοΈ null |
π’ | Simple-3 | βοΈ 399 | βοΈ unitTest(Simple-3): not(number(1.0) > number(1.0)) | βοΈ null |
π’ | Simple-4 | βοΈ 499 | βοΈ unitTest(Simple-4): number(1.0000000001) > number(1.0) | βοΈ null |
π’ | Precision-1 | βοΈ 599 | βοΈ unitTest(Precision-1): number(1.111111111222224E9) > number(1.111111111222223E9) | βοΈ null |
π’ | Precision-2 | βοΈ 699 | βοΈ unitTest(Precision-2): number(1.1111111112222235E9) > number(1.1111111112222233E9) | βοΈ null |
π’ | Precision-3 | βοΈ 799 | βοΈ unitTest(Precision-3): not(number(1.1111111112222235E9) > number(1.1111111112222235E9)) | βοΈ null |
π’ | Null-1 | βοΈ 899 | βοΈ unitTest(Null-1): not(null > null) | βοΈ null |
π’ | Null-2 | βοΈ 999 | βοΈ unitTest(Null-2): not(number(-1.0) > null) | βοΈ null |
π’ | Null-3 | βοΈ 1099 | βοΈ unitTest(Null-3): not(number(1.0) > null) | βοΈ null |
π’ | Null-4 | βοΈ 1199 | βοΈ unitTest(Null-4): not(null > number(-1.0)) | βοΈ null |
π’ | Null-5 | βοΈ 1299 | βοΈ unitTest(Null-5): not(null > number(1.0)) | βοΈ null |
π’ | Duration-1 | βοΈ 1399 | βοΈ unitTest(Duration-1): 'PT1M' > 'PT1S' | βοΈ null |
π’ | Duration-2 | βοΈ 1499 | βοΈ unitTest(Duration-2): '1m'.asDuration() > 'PT1S' | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/greater-than/policy.yaml | 2F2E803A5F7D5E596C739C941D1DEB3E |
Open | /ce/unit-test/greater-than/unit-test.logic.yaml | 460FC255850B5AE7F4D64235A4F9062F |
Open | /ce/unit-test/greater-than/test-data.json | F93C2BC6FE1DC4A56B92D9EEBE4BD49C |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/greater-than/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/greater-than/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/greater-than/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/greater-than/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/greater-than/unit-test.logic.yaml
Contentβ
---
inputType: CA10__CaAwsInstance__c
testData:
- file: test-data.json
conditions:
- status: COMPLIANT
currentStateMessage: Simple-1
check:
UNIT_TEST:
id: Simple-1
arg:
NOT:
arg:
GREATER_THAN:
left:
NUMBER: 0
right:
NUMBER: 1
- status: COMPLIANT
currentStateMessage: Simple-2
check:
UNIT_TEST:
id: Simple-2
arg:
GREATER_THAN:
left:
NUMBER: 1
right:
NUMBER: 0
- status: COMPLIANT
currentStateMessage: Simple-3
check:
UNIT_TEST:
id: Simple-3
arg:
NOT:
arg:
GREATER_THAN:
left:
NUMBER: 1
right:
NUMBER: 1
- status: COMPLIANT
currentStateMessage: Simple-4
check:
UNIT_TEST:
id: Simple-4
arg:
GREATER_THAN:
left:
NUMBER: 1.0000000001
right:
NUMBER: 1
- status: COMPLIANT
currentStateMessage: Precision-1
check:
UNIT_TEST:
id: Precision-1
arg:
GREATER_THAN:
left:
NUMBER: 1111111111.222224
right:
NUMBER: 1111111111.222223
- status: COMPLIANT
currentStateMessage: Precision-2
check:
UNIT_TEST:
id: Precision-2
arg:
GREATER_THAN:
left:
NUMBER: 1111111111.2222235
right:
NUMBER: 1111111111.2222234
- status: COMPLIANT
currentStateMessage: Precision-3
check:
UNIT_TEST:
id: Precision-3
arg:
NOT:
arg:
GREATER_THAN:
left:
NUMBER: 1111111111.22222346
right:
NUMBER: 1111111111.22222345
- status: COMPLIANT
currentStateMessage: Null-1
check:
UNIT_TEST:
id: Null-1
arg:
NOT:
arg:
GREATER_THAN:
left:
UNIT_TEST_NULL:
returnType: NUMBER
right:
UNIT_TEST_NULL:
returnType: NUMBER
- status: COMPLIANT
currentStateMessage: Null-2
check:
UNIT_TEST:
id: Null-2
arg:
NOT:
arg:
GREATER_THAN:
left:
NUMBER: -1
right:
UNIT_TEST_NULL:
returnType: NUMBER
- status: COMPLIANT
currentStateMessage: Null-3
check:
UNIT_TEST:
id: Null-3
arg:
NOT:
arg:
GREATER_THAN:
left:
NUMBER: 1
right:
UNIT_TEST_NULL:
returnType: NUMBER
- status: COMPLIANT
currentStateMessage: Null-4
check:
UNIT_TEST:
id: Null-4
arg:
NOT:
arg:
GREATER_THAN:
left:
UNIT_TEST_NULL:
returnType: NUMBER
right:
NUMBER: -1
- status: COMPLIANT
currentStateMessage: Null-5
check:
UNIT_TEST:
id: Null-5
arg:
NOT:
arg:
GREATER_THAN:
left:
UNIT_TEST_NULL:
returnType: NUMBER
right:
NUMBER: 1
- status: COMPLIANT
currentStateMessage: Duration-1
check:
UNIT_TEST:
id: Duration-1
arg:
GREATER_THAN:
left:
DURATION: "PT1M"
right:
DURATION: "PT1S"
- status: COMPLIANT
currentStateMessage: Duration-2
check:
UNIT_TEST:
id: Duration-2
arg:
GREATER_THAN:
left:
DURATION_FROM:
arg:
TEXT: "1m"
format: GCP
undeterminedIf:
isEmpty: "Should not happen"
invalidFormat: "Should not happen"
right:
DURATION: "PT1S"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required