// Should catch the exception
}
// Test 2
doReturn( true ).when( schedulerService ).isScheduleAllowed();
doThrow( new SchedulerException( "" ) ).when( schedulerService ).removeJob( anyString() );
try {
schedulerService.updateBlockout( jobId, jobScheduleRequest );
fail();
} catch ( SchedulerException e ) {
// Should catch the exception
}
// Test 3
doReturn( false ).when( schedulerService ).removeJob( anyString() );
try {
schedulerService.updateBlockout( jobId, jobScheduleRequest );
fail();
} catch ( IllegalArgumentException e ) {
// Should catch the exception
}
// Test 4
doReturn( true ).when( schedulerService ).removeJob( anyString() );
doThrow( new IOException() ).when( schedulerService ).addBlockout( jobScheduleRequest );
try {
schedulerService.updateBlockout( jobId, jobScheduleRequest );
fail();
} catch ( IOException e ) {
// Should catch the exception
}
// Test 5
doThrow( new SchedulerException( "" ) ).when( schedulerService ).addBlockout( jobScheduleRequest );
try {
schedulerService.updateBlockout( jobId, jobScheduleRequest );
fail();
} catch ( SchedulerException e ) {