camunda-community-hub / camunda-platform-scenario Goto Github PK
View Code? Open in Web Editor NEWEasily execute Camunda process scenarios and verify your expectations with Given/Then/When style tests.
License: Apache License 2.0
Easily execute Camunda process scenarios and verify your expectations with Given/Then/When style tests.
License: Apache License 2.0
Framework by default ignores transaction borders.
How to turn OFF this behaviour to stop at defined element with transaction?
(to have done something and then go further with turned ON ignoring)
Thank you, Martin.
I use camunda-bpm-assert-scenario in combination with camunda-bpmn-process-test-coverage. I built a test covering all nodes but the overall coverage is still not 100%. My process includes a call-activity which runs using a default scenario. For this reason the call-activity's coverage is not 100% (in fact 87.1%) and this coverage affects the overall coverage of the parent process. Since the call-activity's process got its own test I do not force the parent's process test to gain 100% coverage of the call-activity's process.
Could you add something like
when(parentScenario.runsCallActivity("CallActivity")).thenReturn(
Scenario.mock((callActivity) -> callActivity.complete(withVariables("A", Boolean.TRUE)));
to mock entire call-activities?
If a missed anything I appreciate every hint.
Regards
Hey @celanthe I staged a first 2.0 version 2.0.0.alpha.1 - now including not just one, but three jar artifacts: camunda-platform-scenario-runner, camunda-platform-scenario-cucumber and camunda-platform-scenario-report - could you please publish to maven central! Thank you! โค๏ธ ๐
Given a diagram like that
...how can I work with Process 2 using scenario?
Message correlation could happen by expression or by a JavaDelegate. I can verify that Process 2 is indeed started correctly and waiting at the user task by using processInstanceQuery()
. Is there any way to perform scenario based testing on this instance just like with the main process?
Is this what is meant by #3 ?
Thanks in advance
Without the ability to change in-time output of mocked elements, which are the part of a looped scenario, the test become endless.
How should be solved such a case with your lib?
The project seems to be updated to version 1.0.0. But it is not yet reflected in maven central yet (still shows v0.2). Is it still in testing?
Remove most of the code in the process engine extension for JUnit5 once this is accepted and released: camunda-community-hub/camunda-bpm-junit5#13
Is there a possibility to start the de process Instance with a businessKey. I only see a way to start test a instance with variables.
Or this already possible ?
With a DMN only @deployment annotation, the DMNs are deployed to a standalone engine
The following code causes failure when using Oracle as a database.
getExternalTaskService().fetchAndLock(Integer.MAX_VALUE, WORKER_ID).topic(getDelegate().getTopicName(), Long.MAX_VALUE).execute();
The following exception bubbles up:
### Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity.updateExternalTask (batch index #1) failed. Cause: java.sql.BatchUpdateException: Year out of range.
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity.updateExternalTask (batch index #1) failed. Cause: java.sql.BatchUpdateException: Year out of range.
java.sql.BatchUpdateException: Year out of range.
java.sql.SQLException: Year out of range.
'. Flush summary:
[
UPDATE ExternalTaskEntity[e90d7c02-908f-11eb-99c6-f61408adc9c9]
]
Hi @celanthe I had travis-ci.org running for this library. Now after the migration to camunda-community-hub it is not working anymore. Furthermore, travis-ci.org will be shutting down in several weeks, with all accounts migrating to travis-ci.com. I therefore requested authorization for this repository via travis-ci.com - can you grant and enable this for me?
That'd be awesome! ๐
Thank you, Martin
Main POM
<groupId>org.camunda.bpm.extension.scenario</groupId>
<artifactId>camunda-platform-scenario-runner</artifactId>
Root POM (with a 'project' group id used for all not published artifacts, too, like integration test modules)
<groupId>org.camunda.bpm.extension.scenario.project</groupId>
<artifactId>camunda-platform-scenario-root</artifactId>
Deprecated POM (used so far)
<groupId>org.camunda.bpm.extension</groupId>
<artifactId>camunda-bpm-assert-scenario</artifactId>
I've found the phrase in project's README
Eliminate almost all querying for runtime objects as e.g. tasks, you get the instances injected into your actions
But haven't found how to do this (e.g. here) - is this function present now?
How can i inject the stub of Service Task? Otherwise, if this Service Task does any request, it's necessary to mock the appropriate service even if you dont need to do this.
Hi Martin
using the org.camunda.bpm.extension groupId leads to a very unstructured maven repo view, where all extensions, there parents/roots and their examples lie in the same folder. Not only is this "ugly", it also gets annoying when you are using autocompletion when you are writing your pom ... you just get a lot of valid suggestions although you are only interested in one extension.
For the soon to come spring-boot extension 2.0, I refactored the structucture to look like this: https://app.camunda.com/nexus/content/repositories/camunda-bpm-community-extensions-snapshots/org/camunda/bpm/extension/springboot/
I want to discuss this layout as a new blueprint for new extensions since it (imho) makes navigation a lot simpler without interfering with the poms too much. What do you think?
If you like it, I could assist refactoring the assert-scenario structure ...
Also: we had the discussion "how do we name "pure-parent" poms that are only required to group modules ... and we agreed to use "-root". I noticed that you used "-parent" again. Though even "*-foo" would be okay, for the sake of unification, would you mind changing it?
Hello,
I have a question related to async continuations.
It's critical for my process to set asyncBefore/asyncAfter for some tasks. It will be considered a bug if I forget to do this.
As I understand, camunda-bpm-assert-scenario automatically executes async continuations.
Is it possible to check with camunda-bpm-assert-scenario that a task is async (i.e. I didn't forget to set asyncBefore/asyncAfter attributes for the task)?
Hi Martin,
this tool is what I'm be searching to organize my Camunda Tests. Well done!
I had problems reading the dmn file RiskCheck.dmn in the example app:
By replacing the xml namespace directive with one from a new file it works:
I don't know if it is appropriate but the tests are green :-)
Bye
Fabio
Dear @celanthe - stupid things happen - I had to directly publish a small hotfix release - can you please publish 1.1.1, too ... thank you!
java.lang.NullPointerException
at org.camunda.bpm.scenario.impl.ProcessRunnerImpl.setExecuted(ProcessRunnerImpl.java:189)
at org.camunda.bpm.scenario.impl.ProcessRunnerImpl.run(ProcessRunnerImpl.java:163)
at org.camunda.bpm.scenario.impl.ProcessRunnerImpl.next(ProcessRunnerImpl.java:170)
at org.camunda.bpm.scenario.impl.ScenarioImpl.execute(ScenarioImpl.java:36)
at org.camunda.bpm.scenario.impl.ProcessRunnerImpl.execute(ProcessRunnerImpl.java:114)
at [anonymized].RequestForQuotationTest.testHappyPath(RequestForQuotationTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.camunda.bpm.engine.test.ProcessEngineRule$1.evaluate(ProcessEngineRule.java:165)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.camunda.bpm.engine.test.ProcessEngineRule$1.evaluate(ProcessEngineRule.java:165)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.