Testing images of SonataFlow example applications using Quarkus CLI

After building the image of your application using Quarkus CLI, you can use the built image to do some test with your application.

Prerequisites
Procedure
  1. Start JVM and native Container Images.

    • Example JVM image

    • Example native image

    docker run -it -p 8080:8080 quay.io/kogito/serverless-workflow-greeting-quarkus:1.0
    ...
    INFO  [io.quarkus] (main) serverless-workflow-greeting-quarkus 1.22.1.Final on JVM (powered by Quarkus ${quarkus_platform}) started in 1.302s
    docker run -it -p 8080:8080 quay.io/kogito/serverless-workflow-greeting-quarkus:1.0-native
    ...
    INFO  [io.quarkus] (main) serverless-workflow-greeting-quarkus 1.22.1.Final native (powered by Quarkus ${quarkus_platform}) started in 0.039s

    Note that the startup of native image is faster than the JVM image. The docker deploys the image on your local and you can now execute commands and start testing the workflows behavior.

  2. To invoke the example greeting workflow application, execute the following command once the container is started:

    • Example request

    • Example response

    curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"name": "John", "language": "English"}' http://localhost:8080/jsongreet
    {
        "id": "2acf710d-7e4a-481d-925c-dfd85a369987",
        "workflowdata": {
            "name": "John",
            "language": "English",
            "greeting": "Hello from JSON Workflow, "
        }
    }

This command will trigger the workflows execution and return its output.

More complex workflows require different kind of testing, see the additional resources how to extend the test coverage of your SonataFlow applications.

Found an issue?

If you find an issue or any misleading information, please feel free to report it here. We really appreciate it!