SingleThreadedActors extends Actors { public Executor getExecutor() { return messageListener.getListenedExecutor(new AsynchronousExecutor()); } SingleThreadedActors(EventizerProvider eventizerProvider, FailureHandler failureHandler, MessageListener messageListener); void processEventsUntilIdle(); Executor getExecutor();  }
@Test public void the_asynchronous_executor_is_hooked_into_the_same_MessageListener_as_the_actors_use() { Executor listenedExecutor = mock(Executor.class, "listenedExecutor"); MessageListener messageListener = mock(MessageListener.class); stub(messageListener.getListenedExecutor(Matchers.<Executor>any())).toReturn(listenedExecutor); SingleThreadedActors actors = new SingleThreadedActors(defaultEventizerProvider, defaultFailureHandler, messageListener); Executor asynchronousExecutor = actors.getExecutor(); assertThat(asynchronousExecutor, is(listenedExecutor)); }