@Test
void should_VerifyMethodInvocations_When_QueryTaskHistoryEvent() throws Exception {

  List<TaskHistoryEvent> returnList = new ArrayList<>();
  returnList.add(
      AbstractAccTest.createTaskHistoryEvent(
          "wbKey1", "taskId1", "type1", "wbKey2", "someUserId", "someDetails"));
  when(taskanaHistoryEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
  when(sqlSessionMock.selectList(any(), any())).thenReturn(new ArrayList<>(returnList));
  final List<TaskHistoryEvent> result =
      cutSpy.createTaskHistoryQuery().taskIdIn("taskId1").list();
  verify(taskanaHistoryEngineMock, times(1)).openConnection();
  verify(taskanaHistoryEngineMock, times(1)).getSqlSession();
  verify(sqlSessionMock, times(1)).selectList(any(), any());
  verify(taskanaHistoryEngineMock, times(1)).returnConnection();
  assertThat(result).hasSize(returnList.size());
  assertThat(result.get(0).getWorkbasketKey()).isEqualTo(returnList.get(0).getWorkbasketKey());
}