Use Camunda 7's JUnit 5 extension in place of its ProcessEngineRule

Proprietary

The JUnit 5 migration that comes with the Spring Boot upgrade moves the @Tests of a Camunda 7 process test to JUnit Jupiter, but leaves its ProcessEngineRule, a JUnit 4 rule that Jupiter doesn't apply. In a test class whose tests are on Jupiter, the rule becomes a ProcessEngineExtension registered with @RegisterExtension, built from the same configuration resource or process engine, and process test coverage's rule becomes its ProcessEngineCoverageExtension. A Spring test's rule that a @PostConstruct method makes of the application's process engine, as Camunda's Spring Boot archetype has it, becomes an extension of that engine registered on the test instance, and a @SpringBootTest that recorded process test coverage imports process test coverage's Spring configuration. A test that extends the Spring Boot starter's AbstractProcessEngineRuleTest gets the extension its rule was. The rule deployed the processes of @Deployment before @Before ran, where the extension deploys them after @BeforeEach, so a @BeforeEach method that uses the engine runs as a callback registered after the extension instead. A rule that is assigned elsewhere, or used other than through the methods both have, is left alone.

io.moderne.camunda.camunda8.MigrateProcessEngineRuleToJUnit5
mod run . --recipe=io.moderne.camunda.camunda8.MigrateProcessEngineRuleToJUnit5

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.