AbstractAcmeProvider implements AcmeProvider { @Override public Connection connect(URI serverUri) { return new DefaultConnection(createHttpConnector()); }  @Override Connection connect(URI serverUri); @Override JSON directory(Session session, URI serverUri); @Override Challenge createChallenge(Login login, JSON data);  }
@Test public void testConnect() { final AtomicBoolean invoked = new AtomicBoolean(); AbstractAcmeProvider provider = new TestAbstractAcmeProvider() { @Override protected HttpConnector createHttpConnector() { invoked.set(true); return super.createHttpConnector(); } }; Connection connection = provider.connect(SERVER_URI); assertThat(connection, not(nullValue())); assertThat(connection, instanceOf(DefaultConnection.class)); assertThat(invoked.get(), is(true)); }