@Test
@SuppressWarnings( "unchecked" )
public void testApplicationDeleted_exceptionWhileDeletingJobs() throws Exception {

	RoboconfScheduler roboconfScheduler = Mockito.mock( RoboconfScheduler.class );
	Mockito
		.doThrow( new IOException( "For test" ))
		.when( roboconfScheduler ).deleteJob( Mockito.anyString());
	Set<TriggerKey> triggerKeys = new HashSet<> ();
	triggerKeys.add( new TriggerKey( "job", "app" ));
	roboconfScheduler.scheduler = Mockito.mock( Scheduler.class );
	Mockito
		.when( roboconfScheduler.scheduler.getTriggerKeys( Mockito.any( GroupMatcher.class )))
		.thenReturn( triggerKeys );
	ManagerListener listener = new ManagerListener( roboconfScheduler );
	listener.application(
			new Application( "app", Mockito.mock( ApplicationTemplate.class )),
			EventType.DELETED );
	Mockito
		.verify( roboconfScheduler.scheduler, Mockito.times( 1 ))
		.getTriggerKeys( Mockito.any( GroupMatcher.class ));
	Mockito
		.verify( roboconfScheduler, Mockito.times( 1 ))
		.deleteJob( Mockito.anyString());
}