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?