SchedulerService { public BlockStatusProxy getBlockStatus( JobScheduleRequest jobScheduleRequest ) throws SchedulerException { updateStartDateForTimeZone( jobScheduleRequest ); IJobTrigger trigger = convertScheduleRequestToJobTrigger( jobScheduleRequest ); Boolean totallyBlocked = false; Boolean partiallyBlocked = getBlockoutManager().isPartiallyBlocked( trigger ); if ( partiallyBlocked ) { totallyBlocked = !getBlockoutManager().willFire( trigger ); } return getBlockStatusProxy( totallyBlocked, partiallyBlocked ); }  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 testGetBlockStatus() throws Exception { JobScheduleRequest jobScheduleRequestMock = mock( JobScheduleRequest.class ); BlockStatusProxy blockStatusProxyMock = mock( BlockStatusProxy.class ); IJobTrigger jobTrigger = mock( IJobTrigger.class ); doReturn( jobTrigger ).when( schedulerService ).convertScheduleRequestToJobTrigger( jobScheduleRequestMock ); doReturn( true ).when( schedulerService.blockoutManager ).isPartiallyBlocked( jobTrigger ); doReturn( true ).when( schedulerService.blockoutManager ).willFire( jobTrigger ); doReturn( blockStatusProxyMock ).when( schedulerService ).getBlockStatusProxy( anyBoolean(), anyBoolean() ); BlockStatusProxy blockStatusProxy = schedulerService.getBlockStatus( jobScheduleRequestMock ); assertNotNull( blockStatusProxy ); doReturn( false ).when( schedulerService.blockoutManager ).isPartiallyBlocked( jobTrigger ); blockStatusProxy = schedulerService.getBlockStatus( jobScheduleRequestMock ); assertNotNull( blockStatusProxy ); verify( schedulerService, times( 2 ) ).convertScheduleRequestToJobTrigger( jobScheduleRequestMock ); verify( schedulerService.blockoutManager, times( 2 ) ).isPartiallyBlocked( jobTrigger ); verify( schedulerService, times( 2 ) ).getBlockStatusProxy( anyBoolean(), anyBoolean() ); verify( schedulerService.blockoutManager, times( 1 ) ).willFire( jobTrigger ); }