package roboguice.event.eventListener;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
/**
* Tests for the RunnableAsyncTaskAdaptor class
*
* @author John Ericksen
*/
public class RunnableAsyncTaskAdaptorTest {
@SuppressWarnings("rawtypes")
protected EventListenerRunnable runnable;
protected RunnableAsyncTaskAdaptor runnableAdaptor;
@Before
public void setup(){
runnable = mock(EventListenerRunnable.class);
runnableAdaptor = new RunnableAsyncTaskAdaptor(runnable);
}
@Test
public void test() throws Exception {
reset(runnable);
runnable.run();
runnableAdaptor.call();
verify(runnable, Mockito.atLeastOnce()).run();
}
}