@@ -0,0 +1,1991 @@
+package net.kencochrane.raven.connection;%0A%0Aimport net.kencochrane.raven.event.Event;%0Aimport net.kencochrane.raven.event.EventBuilder;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.invocation.InvocationOnMock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport org.mockito.stubbing.Answer;%0A%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.doAnswer;%0Aimport static org.mockito.Mockito.verify;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class AsyncConnectionTest %7B%0A    private AsyncConnection asyncConnection;%0A    @Mock%0A    private Connection mockConnection;%0A    @Mock%0A    private ExecutorService mockExecutorService;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        asyncConnection = new AsyncConnection(mockConnection);%0A        asyncConnection.setExecutorService(mockExecutorService);%0A    %7D%0A%0A    @Test%0A    public void testCloseOperation() throws Exception %7B%0A        asyncConnection.close();%0A%0A        verify(mockConnection).close();%0A        verify(mockExecutorService).awaitTermination(any(Long.class), any(TimeUnit.class));%0A    %7D%0A%0A    @Test%0A    public void testSendEventQueued() throws Exception %7B%0A        Event event = new EventBuilder().build();%0A%0A        asyncConnection.send(event);%0A%0A        verify(mockExecutorService).execute(any(Runnable.class));%0A    %7D%0A%0A    @Test%0A    public void testQueuedEventExecuted() throws Exception %7B%0A        Event event = new EventBuilder().build();%0A        doAnswer(new Answer%3CVoid%3E() %7B%0A            @Override%0A            public Void answer(InvocationOnMock invocation) throws Throwable %7B%0A                ((Runnable) invocation.getArguments()%5B0%5D).run();%0A                return null;%0A            %7D%0A        %7D).when(mockExecutorService).execute(any(Runnable.class));%0A%0A        asyncConnection.send(event);%0A%0A        verify(mockConnection).send(event);%0A    %7D%0A%7D%0A

Add tests for the AsyncConnection