SlowMessageNotification extends NotifyingInterceptor { long notifyThreshold() { return TimeInterval.toMillisecondsDefaultIfNull(getNotifyThreshold(), DEFAULT_THRESHOLD); } SlowMessageNotification();  SlowMessageNotification(String uid, TimeInterval threshold);   SlowMessageNotification(String uid, TimeInterval threshold, TimeInterval cleanup); @Override void workflowStart(AdaptrisMessage inputMsg); @Override void workflowEnd(AdaptrisMessage inputMsg, AdaptrisMessage outputMsg); @Override void init(); @Override void start(); @Override void stop(); @Override void close(); TimeInterval getNotifyThreshold(); void setNotifyThreshold(TimeInterval t); static final String KEY_MESSAGE_ID; static final String KEY_MESSAGE_START; static final String KEY_MESSAGE_END; static final String KEY_MESSAGE_DURATION; static final String KEY_MESSAGE_SUCCESS; }
@Test public void testNotifyThreshold() throws Exception { SlowMessageNotification notif = new SlowMessageNotification(); final TimeInterval defaultThreshold = new TimeInterval(1L, TimeUnit.MINUTES); assertNull(notif.getNotifyThreshold()); assertEquals(defaultThreshold.toMilliseconds(), notif.notifyThreshold()); TimeInterval newInterval = new TimeInterval(10L, TimeUnit.MINUTES); notif.setNotifyThreshold(newInterval); assertNotNull(notif.getNotifyThreshold()); assertEquals(newInterval, notif.getNotifyThreshold()); assertEquals(newInterval.toMilliseconds(), notif.notifyThreshold()); }