SchedulerService { public List<RepositoryFileDto> doGetGeneratedContentForSchedule( String lineageId ) throws FileNotFoundException { return getFileService().searchGeneratedContent( getSessionResource().doGetCurrentUserDir(), lineageId, QuartzScheduler.RESERVEDMAPKEY_LINEAGE_ID ); }  Job createJob( JobScheduleRequest scheduleRequest ); Job updateJob( JobScheduleRequest scheduleRequest ); Job triggerNow( String jobId ); Job getContentCleanerJob(); List<RepositoryFileDto> doGetGeneratedContentForSchedule( String lineageId ); Job getJob( String jobId ); boolean isScheduleAllowed(); boolean isScheduleAllowed( String id ); IJobFilter getJobFilter( boolean canAdminister, String principalName ); String doGetCanSchedule(); String getState(); String start(); String pause(); String shutdown(); JobState pauseJob( String jobId ); JobState resumeJob( String jobId ); boolean removeJob( String jobId ); Job getJobInfo( String jobId ); List<Job> getBlockOutJobs(); boolean hasBlockouts(); boolean willFire( IJobTrigger trigger ); boolean shouldFireNow(); Job addBlockout( JobScheduleRequest jobScheduleRequest ); Job updateBlockout( String jobId, JobScheduleRequest jobScheduleRequest ); BlockStatusProxy getBlockStatus( JobScheduleRequest jobScheduleRequest ); JobScheduleRequest getJobInfo(); JobState getJobState( JobRequest jobRequest ); Class<IAction> getAction( String actionClass ); IUnifiedRepository getRepository(); IScheduler getScheduler(); IAuthorizationPolicy getPolicy(); boolean getAutoCreateUniqueFilename( final JobScheduleRequest scheduleRequest ); String getAppendDateFormat( final JobScheduleRequest scheduleRequest ); List<Job> getJobs();  }
@Test public void testDoGetGeneratedContentForSchedule() throws Exception { String lineageId = "test.prpt"; FileService mockFileService = mock( FileService.class ); doReturn( mockFileService ).when( schedulerService ).getFileService(); SessionResource mockSessionResource = mock( SessionResource.class ); doReturn( mockSessionResource ).when( schedulerService ).getSessionResource(); String currentUserDir = "currentUserDir"; doReturn( currentUserDir ).when( mockSessionResource ).doGetCurrentUserDir(); List<RepositoryFileDto> mockList = mock( List.class ); doReturn( mockList ).when( mockFileService ) .searchGeneratedContent( currentUserDir, lineageId, QuartzScheduler.RESERVEDMAPKEY_LINEAGE_ID ); List<RepositoryFileDto> list = schedulerService.doGetGeneratedContentForSchedule( lineageId ); assertEquals( mockList, list ); }