Mocking Camunda Decision Service

I am trying to mock the results retrieved from a DMN table and then unit test the subsequent business logic.

How can I mock the following API call? I tried method chaining with Mockito but it was passing a null between DmnDecisionTableResult and getResultList()

final List<Map<String, Object>> changeLevelThrees =
              decisionService.evaluateDecisionTableByKey(CHANGE_LEVEL_3_DMN, variables)
                  .getResultList();

This is how I mocked it but as I said, getResultList() throws NPE:

  when(decisionService.evaluateDecisionTableByKey(CHANGE_LEVEL_3_DMN, variables).collectEntries("foo"))
    .thenReturn(ImmutableList.of("AA","BB));

Any ideas how to unit test with the DecisionService?

Hi @CamundaCommando,

what about deploying the decisionTable with the process like

@Deployment(resources= {"myProcess.bpmn", "myDecision.dmn"})

?
Or starting the process after the business rule task with

runtimeService().createProcessInstanceByKey("myKey").startAfterActivity("myBusinessRuleTask").setVariables(allMyVariablesIncludeTheResultOfTheDecisionTable);

?
Hope this helps, Ingo