Testing Dynamic Logic

This page describes the testing of a dynamic logic in Oracle Health Insurance. You can create a test case to verify the correctness of a logic for each use case. A test case is a dynamic logic that runs a test on another dynamic logic unit. It is a dynamic logic with the Test Unit signature. The Test Dynamic Logic Integration Point tests a single test case.

You must create short test cases that test a single use case for a unit.
Oracle Health Insurance applications cannot test multiple test cases at one go.

A typical test case looks like:

//1.
def input1 = <<some expression>>
def input2 = <<some expression>>
//2.
def result = test( "<Dynamic Logic Code>", [
    "<key1>" : input1,
    "<key2>" : input2
])

//3.
if( result.<<some_check>>) {
    log.error( "<Some error message>" )
    return false
} else {
    log.info( "<Some success message>" )
    return true
}
  1. Creating Input Objects: You can create them in your test case or access them from the application database.

  2. Calling the Unit Under Test (UUT): By using the test predefined function.

  3. Verifying the Outcome: Returns true when the test runs successfully and is false when it fails.

Security Context

There are provisions to protect the application from actions possible in any dynamic logic. There are no such restrictions in a test case. You can define any object in any state as input to the test function in the second step. The test function has the same restrictions as the application has for the actual invocation.

Changing any object in a test case does not affect the idempotency of the test. A dynamic logic with a Test Unit signature is marked rollback-only. So, no changes in the test case are saved in the database permanently.

How to Test Dynamic Logic

For the step-by-step process to test a dynamic logic, refer to How to Test Dynamic Logic.