@Test
public void updateTriggerTest() throws Exception {

    toTest.updateTrigger(new DefaultTriggerIdentifier("trigger-key-name", "trigger-key-name"),
                         "0 0 12 * * ?");
    verify(scheduler).rescheduleJob(eq(new TriggerKey("trigger-key-name", "trigger-key-name")),
                                    (Trigger) any());
    doThrow(new SchedulerException()).when(scheduler).rescheduleJob((TriggerKey) any(),
                                                                    (Trigger) any());
    try {
        toTest.updateTrigger(new DefaultTriggerIdentifier("trigger-key-name", "trigger-key-name"),
                             "0 0 12 * * ?");
    } catch (final JobSchedulerException e) {
        return;
    }
    fail();
}