DMN artifact contins rule for JUnit4, but not a similar way for JUnit5

Hi guys,

In regard to the post here: [Junit5] ProcessEngineRule compatibility with Junit5 - #8 by Ingo_Richtsmeier

Just to get your feedback on the following point:

In JUnit4, the DMN Engine dependency comes with a JUnit Rule, tests in JUnit4 use the DmnEngineRule for bootstrapping the DMN engine, and then get the DMN engine with

@Rule
  public DmnEngineRule dmnEngineRule = new DmnEngineRule();

  @Test
  public void test() {
    DmnEngine dmnEngine = dmnEngineRule.getDmnEngine();

As demonstrated in Testing Decisions with the DMN Engine | docs.camunda.org
All in one single artifact: camunda-engine-dmn.

In JUnit5, the Rule is obsolete, as @Rule is replaced by @ExtendWith. The new annotation bootstraps the engine, same principle so far, then to get the DMN we have to ask the decisionService to evaluate the table as:

DmnDecisionTableResult tableResult = decisionService().evaluateDecisionTableByKey("tweetApproval", variables);

Here is the catch, the decision service is only available in the artifact: camunda-engine-7.X.jar, so one more artifact. . What if a project contains only the DMN artifact embedded, as mentioned here Embedding the DMN Engine | docs.camunda.org

Meaning, I have to include the whole process engine artifact in order to access the decision service in my tests, even if I do not want to access the other services.

Is there a way to test the DMN Engine with only the DMN engine artifact in JUnit5, as it was possible in JUnit4 ?

Any input is greatly appreciated.

Cheers

Hi @g.manzano,

In the product or community space I am not aware of an extension for isolated DMN testing. You could create your own, having a look at the process engine extension and given that DmnEngineRule does not more than bootstrapping a DMN engine, that should not be too complex.

Cheers,
Thorben

Thanks @thorben for the input, so I now know you guys probably won’t develop at the moment something like that. Indeed, not complicated but I waited for the answer as I thought “if it is in the roadmap and coming out soon, it would be worth waiting”.

Cheers :slight_smile:

That’s correct. With 7.17, we are moving the JUnit5 extension for ProcessEngine-based tests to the product and bring it feature-wise on par with ProcessEngineRule, see https://jira.camunda.com/browse/CAM-11955. But no plans to have a dedicated extension for DMN testing right now.