TrackerImpl implements Tracker { boolean saveTrackerOperation( String source, TrackerOperationImpl po ) { Preconditions.checkArgument( !StringUtils.isBlank( source ), SOURCE_IS_EMPTY_MSG ); Preconditions.checkNotNull( po, "Tracker operation is null" ); try { long userId; User user = identityManager.getActiveUser(); if ( user != null ) { userId = user.getId(); } else { userId = identityManager.getSystemUser().getId(); } dataService.saveTrackerOperation( source, po, userId ); return true; } catch ( Exception e ) { LOG.error( "Error in saveTrackerOperation", e ); } return false; }  @Override TrackerOperationView getTrackerOperation( String source, UUID operationTrackId ); @Override TrackerOperation createTrackerOperation( String source, String description ); @Override List<TrackerOperationView> getTrackerOperations( String source, Date fromDate, Date toDate, int limit ); @Override List<String> getTrackerOperationSources(); @Override void printOperationLog( String source, UUID operationTrackId, long maxOperationDurationMs ); @Override void setOperationViewState( String source, UUID operationId, boolean display ); @Override void setOperationsViewStates( boolean display ); @Override List<TrackerOperationView> getNotifications(); void init(); void dispose(); void setDaoManager( final DaoManager daoManager ); void setIdentityManager( final IdentityManager identityManager );  }
@Test public void testSaveTrackerOperation() throws Exception { tracker.saveTrackerOperation( SOURCE, productOperation ); verify( dataService ).saveTrackerOperation( SOURCE, productOperation, identityManager.getActiveUser().getId() ); }