@Test
public void testExceptionReportingScheduleAtFixedRate() throws InterruptedException {

	final AtomicBoolean exceptionWasThrown = new AtomicBoolean(false);
	final OneShotLatch latch = new OneShotLatch();
	final Object lock = new Object();
	ProcessingTimeService timeServiceProvider = new SystemProcessingTimeService(
		new AsyncExceptionHandler() {
			@Override
			public void handleAsyncException(String message, Throwable exception) {
				exceptionWasThrown.set(true);
				latch.trigger();
			}
		}, lock);
	timeServiceProvider.scheduleAtFixedRate(
		new ProcessingTimeCallback() {
		@Override
		public void onProcessingTime(long timestamp) throws Exception {
			throw new Exception("Exception in Timer");
		}
	},
		0L,
		100L);
	latch.await();
	assertTrue(exceptionWasThrown.get());
}