-
Notifications
You must be signed in to change notification settings - Fork 194
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
Document Spring SDK 8.6.7+ Testing support #4845
Conversation
👋 🤖 🤔 Hello, @mesellings! Did you make your changes in all the right places? These files were changed only in docs/. You might want to duplicate these changes in versioned_docs/version-8.6/.
You may have done this intentionally, but we wanted to point it out in case you didn't. You can read more about the versioning within our docs in our documentation guidelines. |
@@ -162,3 +162,44 @@ public void handleJobFoo(final ActivatedJob job) { | |||
``` | |||
|
|||
See [the configuration documentation](/apis-tools/spring-zeebe-sdk/configuration.md) for a more in-depth discussion on parameters and configuration options for job workers. | |||
|
|||
## Writing test cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taken with minor changes from https://github.com/camunda-community-hub/spring-zeebe/blob/main/README.md#writing-test-cases
b9a9579
to
c833ef2
Compare
c833ef2
to
3c8c34c
Compare
@megglos Are you happy for me to make changes directly to the branch rather than trying to fit them into individual comments? They are all basically rewording, but might just be a lot cleaner? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@megglos thank you for adding these changes. 👍 I have a few minor comments and I recommend moving the docs to a different place. Please have a look. 🍪
docs/components/best-practices/development/testing-process-definitions.md
Outdated
Show resolved
Hide resolved
docs/components/best-practices/development/testing-process-definitions.md
Outdated
Show resolved
Hide resolved
versioned_docs/version-8.6/components/best-practices/development/testing-process-definitions.md
Outdated
Show resolved
Hide resolved
versioned_docs/version-8.6/components/best-practices/development/testing-process-definitions.md
Outdated
Show resolved
Hide resolved
You can start up an in-memory test engine and do assertions by adding this Maven dependency: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>io.camunda</groupId> | ||
<artifactId>spring-boot-starter-camunda-test</artifactId> | ||
<version>8.6.x</version> | ||
<scope>test</scope> | ||
</dependency> | ||
``` | ||
|
||
Note that **the test engine requires Java version >= 21**. If you cannot run on this Java version, you can use [Testcontainers](https://www.testcontainers.org/) **instead**. Testcontainers require that you have a Docker installation locally available on the developer machine. Use this dependency: | ||
|
||
```xml | ||
<!-- | ||
Alternative dependency if you cannot run Java 21, so you will leverage Testcontainer | ||
Make sure NOT to have spring-zeebe-test on the classpath in parallel! | ||
--> | ||
<dependency> | ||
<groupId>io.camunda</groupId> | ||
<artifactId>spring-boot-starter-camunda-test-testcontainer</artifactId> | ||
<version>8.6.x</version> | ||
<scope>test</scope> | ||
</dependency> | ||
``` | ||
|
||
Then, start up the test engine in your test case by adding `@ZeebeSpringTest` | ||
|
||
```java | ||
@SpringBootTest | ||
@ZeebeSpringTest | ||
public class TestMyProcess { | ||
// ... | ||
``` | ||
|
||
An example test case is [available here](https://github.com/camunda-community-hub/camunda-cloud-examples/blob/main/twitter-review-java-springboot/src/test/java/org/camunda/community/examples/twitter/TestTwitterProcess.java). | ||
|
||
> Please do not use `zeebeTestEngine.waitForBusyState(...)` to wait for a timer. This will not work as this is also triggered by an incoming job activation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ We should add this content to the Zeebe Process Test docs instead of the Spring SDK docs. Just add a link in the Spring SDK docs. The Zeebe Process Test docs contain information about writing tests.
With 8.7, Camunda Process Test will become the default testing library and we should change the link to the Camunda Process Test docs.
We can keep the content in the Zeebe Process Test docs for users that still use Zeebe Process Test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for that suggestion, will apply this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with aca17e2
Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
@mesellings I didn't see a commit from you with changes. Will you get to this tomorrow? It looks like we want to move quickly on this PR and I'm wondering if we should pull in a US-based tech writer so you can enjoy your evening. |
@conceptualshark @christinaausley can one of you have a look at this PR so we can (hopefully) get it reviewed and merged today? |
@akeller I'll give this a quick TW review before I finish, so it will jsut be grammar, writing etc rather than anything technical, but at least should help to get it merged, with follow-up PRs tomorrow if need be |
@mesellings I'm done addressing the comments from @saig0 , please address any language matters directly. Thank you! 🙇 |
Actually @akeller I don't think I can manage this review tonight, I did start but changes were still just being committed, so I want to wait until it is closer to completion before I review - I can take a look first thing tomorrow morning though? |
@megglos I thought you'd be offline for sure! If another TW is available, they'll visit this PR. If not, Mark will get it tomorrow morning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@megglos 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@megglos I've made some TW edits directly in the commits and backported for 8.6, nice work, happy to approve! 👍 🚀
@megglos Are you happy for me to merge and release the docs now, or are we still awaiting any other reviews? |
Thank you @mesellings & @saig0 for the quick feedback loop! @mesellings yes, lets merge and publish. |
🧹 Preview environment for this PR has been torn down. |
@mesellings is there a reason why the announcement reads 'Spring SDK test support support in 8.6.7' or is the double 'support' helping overlooked? |
@alexcorremans Well spotted - that's a typo, I'll get that fixed - thank you for noticing this! 🚀 👀 |
@alexcorremans Fixing this in #4871 |
Description
This PR adds all changes needed to make transparent that with the 8.6.7 release going forward the official Spring SDK has testing support on-par with the former community SDK that we aimed towards with this epic camunda/camunda#26423 .
It also adds a note to announcements and the update guide on the actual switch and end-of-life of the community project, which seemed to have been missed previously.
closes
camunda/camunda#26598
camunda/camunda#26600
When should this change go live?
hold
label or convert to draft PR)PR Checklist
/versioned_docs
directory./docs
directory (aka/next/
).