Giter Site home page Giter Site logo

camunda-community-hub / camunda-platform-scenario Goto Github PK

View Code? Open in Web Editor NEW
64.0 11.0 15.0 2.04 MB

Easily execute Camunda process scenarios and verify your expectations with Given/Then/When style tests.

License: Apache License 2.0

Java 99.59% Gherkin 0.41%
waitstates behaviour scenario verify testing bdd-style-testing-framework

camunda-platform-scenario's People

Contributors

actions-user avatar alexanderseik avatar berndruecker avatar celanthe avatar chaima-mnsr avatar cmur2 avatar dependabot[bot] avatar guchman avatar hawky-4s- avatar javabean68 avatar justinwyer avatar martinschimak avatar maxdanilov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camunda-platform-scenario's Issues

Turn off ignoring transaction borders

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.

How to mock a call-activity?

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

Please push 2.0.0.alpha.1 to maven central

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! โค๏ธ ๐Ÿ™

Work with processes started by the scenario

Given a diagram like that

Bildschirmfoto 2021-05-17 um 16 53 14

...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

Create a scenario cucumber module

  • clean deployment/undeployment before after scenario execution
  • consider option to create a report after scenario execution
  • consider to integrate scenario report into cucumber report

Maven central version

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?

Refactor and test cucumber module

  • ci test different cucumber versions
  • create separate test-cucumber integration test module
  • consider transitive dependency to cucumber

Create HTML report

  • one page per scenario showing all related process diagrams with all executed process instances
  • one page per coverage showing one process diagram
  • show historic order of activity instance execution in HTML report
  • provide an easily integratable div to embed one process model with all overlays

Refactor and test report module

  • refactor test report generator into two
  • create separate test-report integration test module
  • return file object holding the report

ServiceTaskExecutable breaks when using Oracle due to Long.MAX_VALUE lock time

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]
]

The underlying date going into Oracle is the following:
image

Enable Travis CI (.com) for Camunda Platform Scenario

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

Rename project and modules and update all dependencies

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>

Is there an ability to mock not a wait-state?

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.

Extend README to reflect status of 2.0.0

  • runner (dependency, read and correct current text, mention mocking call activities)
  • report (dependency, use with junit4, use with junit5, use with cucumber plugin)
  • cucumber (plugin configuration, cucumber-java annotation style only, @deployment annotation)

refactore multi-module project structure

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/

  • the extension has its own groupid
  • on the toplevel are only the extensions you really would want to use
  • examples are a sub folder
  • everything related to project structure (the root poms and the documentation so far) are in the project folder.

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?

How to test asyncBefore/asyncAfter ?

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)?

dmn file cannot be read by modeller 3.3.2

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:
image
By replacing the xml namespace directive with one from a new file it works:
image

I don't know if it is appropriate but the tests are green :-)
image

Bye
Fabio

NullPointerException when deploying a process with a call activity and defining nothing

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.