Junit a DMN with XML as Input Data

Hi all
I have two question:
First: I would like to Test a DMN File with JUNIT having a XML File as Input. I could find only examples with VariableMap and not with “complex type”. Any Idea about it?
Second: Having my XML File as Input i would like to iterate over a couple List Element to be sure that the decision is taking care about all the data.
Any Idea how would work this in an Junit Funktion?

Regards Massimo

Hi @Massimo,

please have a look at the DMN engine documentation: Testing Decisions with the DMN Engine | docs.camunda.org.

The DMN XML file can be loaded via input stream.

You can also pass a complex object (i.e. a POJO) as a variable. The properties can be accessed via dot-notation (e.g. < obj.foo).

There is an interesting blog post about this topic: Testing DMN Decision Tables | Camunda

Or, just using a parameterized JUnit test. See JUnit 5 User Guide

Best regards,
Philipp