@Test
void should_VerifyMethodInvocations_When_QueryWorkbasketHisoryEvent() throws Exception {

  List<WorkbasketHistoryEvent> returnList = new ArrayList<>();
  returnList.add(
      AbstractAccTest.createWorkbasketHistoryEvent(
          "wbKey1", WorkbasketHistoryEventType.CREATED.getName(), "someUserId", "someDetails"));
  when(taskanaHistoryEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
  when(sqlSessionMock.selectList(any(), any())).thenReturn(new ArrayList<>(returnList));
  final List<WorkbasketHistoryEvent> result =
      cutSpy.createWorkbasketHistoryQuery().keyIn("wbKey1").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).getKey()).isEqualTo(returnList.get(0).getKey());
}