Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support scenario-style testing #274

Open
jangalinski opened this issue Jun 26, 2024 · 3 comments
Open

support scenario-style testing #274

jangalinski opened this issue Jun 26, 2024 · 3 comments
Assignees

Comments

@jangalinski
Copy link
Contributor

Use Case:
I have a process that is basically a straight-through process, each task is async but there are no real wait-states like intermediate-events, timers or user-task.
So the majority of my jgiven tests reads:

.job_is_executed("foo")
.and()
.job_is_executed("bar")
...

each service tasks just does a simple data retrieval based on data I mocked beforehand.

Idea:

As an alternative to the imperative testing style we use in camunda-bpm-jgiven todaym where we manually move the token through the process to evaluate each step, we should support a scenario based approach.

I want to write

given().assumeOnWaitstate("foo","Lookup im Backend, liefert variable", stage -> stage.job_is_executed("foo"));

when().processRunsTilEnd(...)

then().has_passed("startEvent,"foo","endEvent")

Implementation

  • loop until processInstance is ended (Attention: isEnded has to be reloaded from the runtimeService, do not use the attribute of the processInstanceSupplier)
  • provide a Map<ActivityId,Consumer<Stage>> where we can register custom behaviour to be executed in the same way as we would in a step-function
@jangalinski jangalinski added this to the 1.21.1 milestone Jun 26, 2024
@jangalinski jangalinski self-assigned this Jun 26, 2024
@jangalinski
Copy link
Contributor Author

Additional ideas: we could make "until end" a predicate and thus also do stuf like stepA-stepB-runUntilStepE-stepF

@zambrovski zambrovski modified the milestones: 1.21.1, 1.22.0 Oct 8, 2024
@zambrovski
Copy link
Member

Any progress on it? Could you provide the implementation?

@zambrovski
Copy link
Member

I think you merged some parts it already - is it fixed?

@zambrovski zambrovski removed this from the 1.22.0 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants