Skip to content

task: Refactor docs module: Reorganize DSL examples and enable Maven test execution #488

Description

@domhanak

The problem

The docs module currently contains various Serverless Workflow Java DSL examples (Event Emission, Conditional Routing, Iteration, Parallel Execution, Context, etc.) loosely grouped in a single base package. Or other example files used in documentation.
To improve code readability, maintainability, and alignment with documentation, these examples need to be separated into feature-specific packages. Additionally, the project's build configuration must be updated to guarantee that all validation tests execute automatically during the standard Maven build lifecycle.

Proposed solution / API

Reorganize Packages: Create feature-specific sub-packages under the main namespace (org.acme.cookbook) or even more granular ( org.acme.events, org.acme.conditional, org.acme.iteration, org.acme.parallel, org.acme.context )

Move Classes: Relocate the workflow definitions (*Workflow.java), their associated data records (e.g., Message, OrdersPayload, ScorePayload), and their respective test classes (*Test.java) into the newly created packages.

Update Mock Setup: Ensure shared test resources, like WireMockResource.java, are either moved to a common test/util package or have their import paths updated across all relocated test classes.

Configure Maven Test Execution: * Verify that the maven-surefire-plugin is correctly configured in the docs module's pom.xml so unit tests run during the mvn test phase.

    Confirm all test classes follow the standard *Test.java naming convention so they are automatically picked up by the build runner.

Alternatives considered

No

Area(s)

  • Runtime / Engine
  • DSL / API
  • Dev UI / Mermaid
  • Persistence
  • Messaging / CloudEvents
  • Observability (Micrometer / OTEL)
  • Docs & examples
  • Agentic AI

Impact & scope

We benefit as the docs module code is more maintainable and readable.
Tests execution of docs examples as part of maven build ensure the example we share with user base are working as expected.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions