package com.bazaarvoice.zookeeper.dropwizard;

import com.bazaarvoice.zookeeper.ZooKeeperConnection;
import org.junit.Test;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class ManagedZooKeeperConnectionTest {
    @Test
    public void testClosesOnStop() throws Exception {
        ZooKeeperConnection zookeeper = mock(ZooKeeperConnection.class);

        ManagedZooKeeperConnection managed = new ManagedZooKeeperConnection(zookeeper);
        managed.stop();

        verify(zookeeper).close();
    }
}

@@ -247,16 +247,157 @@
 nTest %7B%0A
+    @Test(expected = NullPointerException.class)%0A    public void testNullConnection() %7B%0A        new ManagedZooKeeperConnection(null);%0A    %7D%0A%0A
     @Tes

Add test for null connection.