A DMN evaluation, in testing done as shown here:
https://docs.camunda.org/manual/7.17/user-guide/dmn-engine/testing/
will return you a DmnDecisionResult.
This is a Java Object, you can use to access the results.
Example:
package org.camunda.demo;
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult;
import org.camunda.bpm.engine.test.Deployment;
import org.camunda.bpm.engine.test.ProcessEngineRule;
import org.junit.Rule;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.withVariables;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.decisionService;
public class DMNUnitTest {
@Rule
public ProcessEngineRule rule = new ProcessEngineRule();
@Test
@Deployment(resources = {"Buyer.dmn"})
public void testTweetApprovalAlwaysApprovedContent() {
DmnDecisionTableResult results = decisionService().evaluateDecisionTableByKey("Decision_Buyer", withVariables(
"productGroup", "Food",
"productDepartment","Fruit",
"productClass", "",
"halal",false));
assertThat(results).hasSize(1);
assertThat(results.getSingleResult()).containsOnly(entry("candidateGroups", "Fruit"));
}
}