WorldpayOrderCancelNotificationServiceAdapter implements OrderCancelNotificationServiceAdapter { @Override public void sendCancelFinishedNotifications(final OrderCancelRecordEntryModel orderCancelRecordEntryModel) { eventService.publishEvent(new CancelFinishedEvent(orderCancelRecordEntryModel)); }  @Override void sendCancelFinishedNotifications(final OrderCancelRecordEntryModel orderCancelRecordEntryModel); @Override void sendCancelPendingNotifications(final OrderCancelRecordEntryModel orderCancelRecordEntryModel); @Required void setEventService(EventService eventService);  }
@Test public void testSendCancelFinishedNotificationsShouldPublishEvent() throws Exception { testObj.sendCancelFinishedNotifications(orderCancelRecordEntryModelMock); verify(eventServiceMock).publishEvent(cancelFinishedEventCaptor.capture()); final CancelFinishedEvent cancelFinishedEvent = cancelFinishedEventCaptor.getValue(); assertEquals(orderCancelRecordEntryModelMock, cancelFinishedEvent.getCancelRequestRecordEntry()); }