Test Dynamic Logic Integration Point
This integration point allows a user to test a section of dynamic logic that avoids any unrelated data modifications or logs retrieval.
The integration point runs a test case and returns a structured JSON document containing the bind context sent for testing, the result of the operation, and the log messages. A test case is a dynamic logic with a Test Unit signature.
The integration point returns HTTP status codes as defined in the Response Messages page.
The integration point is protected by the testdynamiclogic IP
access restriction .
Operations
To run a test case, send the following request:
HTTP Method |
|
Base URL |
http://<host>:<port>/<context-root>/testdynamiclogic/{dynamicLogicCode} |
Content-Type |
|
Here, you can avoid adding a payload.
- Return Responses
-
The integration point returns the following HTTP status codes:
Status |
Description |
200 |
Shows a successful run of the test, as the test case returns a |
400 |
Shows an unsuccessful run of the test as the test case either returns a |
404 |
Unable to locate a dynamic logic with the Test Unit signature or with the specified Code. |
- Response Body Example
-
To facilitate debugging, the integration point returns the log messages from the test case and the unit under test.
{
"testUnitCode": "<code of the Test Unit>",
"execution": {
"logs": [
{
"timestamp": "2021-06-15T12:00:00.000+01",
"message": "<Log Message>"
},
{
"timestamp": "2021-06-15T12:00:01.000+01",
"message": "<Another Log Message>"
}
]
}
}
For a complete example of how to run a test, refer to How to Test Dynamic Logic.
Implementation Details
The test case invokes another dynamic logic, or a Unit Under Test (UUT). The UUT can change data in the database. However, the transactions in a test case are set to rollback. So, when the test case invokes a UUT, the application does not commit those changes to the database. This makes the test cases independent of each other and idempotent.
Testing of a dynamic logic that interacts with other systems affects idempotency. When the UUT sends a message to another system, there is no way to prevent the after-effects of an incorrect message on the receiving system. Hence, you must test dynamic logic in Development or Test environments only. |