### Question:
SimpleHistoryServiceImpl implements TaskanaHistory { @Override public void create(TaskHistoryEvent event) { try { taskanaHistoryEngine.openConnection(); if (event.getCreated() == null) { Instant now = Instant.now(); event.setCreated(now); } taskHistoryEventMapper.insert(event); } catch (SQLException e) { LOGGER.error("Error while inserting task history event into database", e); } finally { taskanaHistoryEngine.returnConnection(); LOGGER.debug("Exit from create(TaskHistoryEvent event). Returning object = {}.", event); } }  void initialize(TaskanaEngine taskanaEngine); @Override void create(TaskHistoryEvent event); @Override void create(WorkbasketHistoryEvent event); @Override void create(ClassificationHistoryEvent event); @Override void deleteHistoryEventsByTaskIds(List<String> taskIds); TaskHistoryEvent getTaskHistoryEvent(String historyEventId); TaskHistoryQuery createTaskHistoryQuery(); WorkbasketHistoryQuery createWorkbasketHistoryQuery(); ClassificationHistoryQuery createClassificationHistoryQuery();  }### Answer:
@Test void should_VerifyMethodInvocations_When_CreateTaskHistoryEvent() throws Exception { TaskHistoryEvent expectedWb = AbstractAccTest.createTaskHistoryEvent( "wbKey1", "taskId1", "type1", "wbKey2", "someUserId", "someDetails"); cutSpy.create(expectedWb); verify(taskanaHistoryEngineMock, times(1)).openConnection(); verify(taskHistoryEventMapperMock, times(1)).insert(expectedWb); verify(taskanaHistoryEngineMock, times(1)).returnConnection(); assertThat(expectedWb.getCreated()).isNotNull(); }
@Test void should_VerifyMethodInvocations_When_CreateWorkbasketHisoryEvent() throws Exception { WorkbasketHistoryEvent expectedEvent = AbstractAccTest.createWorkbasketHistoryEvent( "wbKey1", WorkbasketHistoryEventType.CREATED.getName(), "someUserId", "someDetails"); cutSpy.create(expectedEvent); verify(taskanaHistoryEngineMock, times(1)).openConnection(); verify(workbasketHistoryEventMapperMock, times(1)).insert(expectedEvent); verify(taskanaHistoryEngineMock, times(1)).returnConnection(); assertThat(expectedEvent.getCreated()).isNotNull(); }