@SuppressWarnings({"rawtypes", "unchecked"})

@Test
public void pauseTriggersOnJobTest() throws Exception {
    mockJobIdentifier("job-name", "group");
    final List list = new ArrayList<Trigger>();
    addMockTrigger(list, "trigger-key-name", "trigger-key-name");
    when(scheduler.getTriggersOfJob(eq(new JobKey("job-name", "group")))).thenReturn(list);
    toTest.pauseTriggersOnJob(jobIdentifier);
    verify(scheduler).pauseTrigger(eq(new TriggerKey("trigger-key-name", "trigger-key-name")));
    doThrow(new SchedulerException()).when(scheduler).getTriggersOfJob((JobKey) any());
    try {
        toTest.pauseTriggersOnJob(jobIdentifier);
    } catch (final JobSchedulerException e) {
        return;
    }
    fail();
}