@@ -0,0 +1,1335 @@
+package net.kencochrane.raven;%0A%0Aimport com.google.common.collect.Iterators;%0Aimport mockit.Injectable;%0Aimport mockit.Mocked;%0Aimport mockit.NonStrictExpectations;%0Aimport mockit.Tested;%0Aimport net.kencochrane.raven.dsn.Dsn;%0Aimport org.testng.annotations.BeforeMethod;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.util.ServiceLoader;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0A%0Apublic class RavenFactoryTest %7B%0A    @Tested%0A    private RavenFactory ravenFactory;%0A    @Mocked%0A    private ServiceLoader mockServiceLoader;%0A%0A    @BeforeMethod%0A    public void setUp() throws Exception %7B%0A        new NonStrictExpectations() %7B%7B%0A            ServiceLoader.load(RavenFactory.class);%0A            result = mockServiceLoader;%0A        %7D%7D;%0A    %7D%0A%0A    @Test%0A    public void testGetFactoriesFromServiceLoader(@Injectable final Raven mockRaven,%0A                                                  @Injectable final Dsn mockDsn) throws Exception %7B%0A        new NonStrictExpectations() %7B%7B%0A            mockServiceLoader.iterator();%0A            result = Iterators.singletonIterator(ravenFactory);%0A            ravenFactory.createRavenInstance(mockDsn);%0A            result = mockRaven;%0A        %7D%7D;%0A%0A        Raven raven = RavenFactory.ravenInstance(mockDsn);%0A%0A        assertThat(raven, is(mockRaven));%0A    %7D%0A%7D%0A

Add a test to ensure that the ServiceLoader is used to load RavenFactories