Skip to content

Commit

Permalink
PTL-1384
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhendry committed Aug 2, 2024
1 parent 52875a3 commit b2c2a30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/03_server/06_state-machine/06_testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ tags:

As State Machine is another layer on Event Handler, the test configuration is same as for Event Handlers.

The Genesis low-code platform provides the `AbstractGenesisTestSupport` abstract class that enables end-to-end testing of specific areas of your application. In this case, we want to ensure that we have a database, seeded with information, and that our Event Handler configuration is used to create our Event Handler. We also need to add the required packages, genesis home and separately set the `IS_SCRIPT` System Definition property to true (This is required as part of the Event Handler initialisation.).
For more information, see the [Testing pages](/operations/testing/integration-testing/).

The Genesis Platform provides the `AbstractGenesisTestSupport` abstract class that enables end-to-end testing of specific areas of your application. In this case, we want to ensure that we have a database, seeded with information, and that our Event Handler configuration is used to create our Event Handler. We also need to add the required packages, genesis home and separately set the `IS_SCRIPT` System Definition property to true (This is required as part of the Event Handler initialisation.).

```kotlin
class EventHandlerTest : AbstractGenesisTestSupport<GenesisSet>(
Expand All @@ -29,8 +31,6 @@ class EventHandlerTest : AbstractGenesisTestSupport<GenesisSet>(
}
```

For more information about `AbstractGenesisTestSupport`, see the [Testing pages](../../../operations/testing/integration-testing/#abstractgenesistestsupport).

Once you have set up your configuration, you can start writing tests against State Machine.

## Writing tests
Expand Down
4 changes: 2 additions & 2 deletions docs/03_server/08_evaluator/04_examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ Add **MYAPP_EVALUATOR** to the file **myapp-service-definitions.xml** inside yo

From the Genesis plugin for Intellij, build the application.

Double-check your [Resource daemon](../../../server/tooling/intellij-plugin/#resource-daemon) using the Genesis Intellij plugin. You should be able to see the **MYAPP_EVALUATOR** process on **Standby**.
Double-check your [Resource daemon](/server/tooling/intellij-plugin/#resource-daemon) using the Genesis Intellij plugin. You should be able to see the **MYAPP_EVALUATOR** process on **Standby**.

This is because the Evaluator process is set to run only on the primary node. Our application only has one node, but we still have to identify it as the Primary node.

Run [SetPrimary](../../../operations/clustering/genesis/#set-the-primary-node) script as explained [here](../../../server/tooling/intellij-plugin/#running-a-genesis-script) and you should be able to see all processes running.
Run the [SetPrimary](/operations/clustering/genesis/#set-the-primary-node) script.

### 2. Create a new class
When the Evaluator is running, create a PositionReport kotlin class to trigger the new event. This class should be created inside your project folder **server/myapp/src/main/kotlin/genesis/global/message/event/**. Use the code below:
Expand Down

0 comments on commit b2c2a30

Please sign in to comment.