@Test public void testGetRouteSynchronousIfQueueFullAndCalledFromSameThread() throws Exception { final DefaultAsyncQueueFullPolicy router = new DefaultAsyncQueueFullPolicy(); assertEquals(EventRoute.SYNCHRONOUS, router.getRoute(currentThreadId(), Level.ALL)); assertEquals(EventRoute.SYNCHRONOUS, router.getRoute(currentThreadId(), Level.OFF)); } }
@Test public void testGetRouteEnqueuesIfQueueFullAndCalledFromDifferentThread() throws Exception { final DefaultAsyncQueueFullPolicy router = new DefaultAsyncQueueFullPolicy(); assertEquals(EventRoute.ENQUEUE, router.getRoute(otherThreadId(), Level.ALL)); assertEquals(EventRoute.ENQUEUE, router.getRoute(otherThreadId(), Level.OFF)); }