@Test public void delete() throws Exception { when(eventOperationsService.createEvent("ASSOCIATION_DELETION", SECURE_USER)).thenReturn(DELETE_EVENT); associationTrackingOperationService.delete(ASSOCIATION, SECURE_USER); assertThat(ASSOCIATION.getEvents()).hasSize(1); assertThat(ASSOCIATION.getEvents()).extracting(Event::getEventType) .containsOnly("ASSOCIATION_DELETION"); assertThat(ASSOCIATION.getEvents()).extracting(event -> event.getUser().getEmail()) .containsOnly(SECURE_USER.getEmail()); assertThat(ASSOCIATION.getEvents()).extracting(Event::getEventDate).isNotNull(); verify(eventOperationsService, times(1)).createEvent("ASSOCIATION_DELETION", SECURE_USER); }
@Override public void delete(Trackable trackable, SecureUser secureUser) { Event deleteEvent = eventOperationsService.createEvent("ASSOCIATION_DELETION", secureUser); trackable.addEvent(deleteEvent); }
AssociationTrackingOperationServiceImpl implements TrackingOperationService { @Override public void delete(Trackable trackable, SecureUser secureUser) { Event deleteEvent = eventOperationsService.createEvent("ASSOCIATION_DELETION", secureUser); trackable.addEvent(deleteEvent); } }
AssociationTrackingOperationServiceImpl implements TrackingOperationService { @Override public void delete(Trackable trackable, SecureUser secureUser) { Event deleteEvent = eventOperationsService.createEvent("ASSOCIATION_DELETION", secureUser); trackable.addEvent(deleteEvent); } @Autowired  AssociationTrackingOperationServiceImpl(EventOperationsService eventOperationsService); }
AssociationTrackingOperationServiceImpl implements TrackingOperationService { @Override public void delete(Trackable trackable, SecureUser secureUser) { Event deleteEvent = eventOperationsService.createEvent("ASSOCIATION_DELETION", secureUser); trackable.addEvent(deleteEvent); } @Autowired  AssociationTrackingOperationServiceImpl(EventOperationsService eventOperationsService); @Override void create(Trackable trackable, SecureUser secureUser); @Override void update(Trackable trackable, SecureUser secureUser,String eventType); @Override void update(Trackable trackable, SecureUser secureUser, String eventType, String description); @Override void delete(Trackable trackable, SecureUser secureUser); }
AssociationTrackingOperationServiceImpl implements TrackingOperationService { @Override public void delete(Trackable trackable, SecureUser secureUser) { Event deleteEvent = eventOperationsService.createEvent("ASSOCIATION_DELETION", secureUser); trackable.addEvent(deleteEvent); } @Autowired  AssociationTrackingOperationServiceImpl(EventOperationsService eventOperationsService); @Override void create(Trackable trackable, SecureUser secureUser); @Override void update(Trackable trackable, SecureUser secureUser,String eventType); @Override void update(Trackable trackable, SecureUser secureUser, String eventType, String description); @Override void delete(Trackable trackable, SecureUser secureUser);  }