@Override
    protected Drive connect(final ProxyFinder proxy, final HostKeyCallback callback, final LoginCallback prompt, final CancelCallback cancel) throws HostParserException, ConnectionCanceledException {
        final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
        authorizationService = new OAuth2RequestInterceptor(builder.build(proxy, this, prompt).build(), host, prompt)
                .withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
        configuration.addInterceptorLast(authorizationService);
        configuration.setServiceUnavailableRetryStrategy(new CustomServiceUnavailableRetryStrategy(host,
                new ExecutionCountServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService))));
        if(new HostPreferences(host).getBoolean("googledrive.limit.requests.enable")) {
            configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter(
                    new HostPreferences(host).getInteger("googledrive.limit.requests.second")
            )));
        }
        transport = new ApacheHttpTransport(configuration.build());
        final UseragentProvider ua = new PreferencesUseragentProvider();
        return new Drive.Builder(transport, new GsonFactory(), new UserAgentHttpRequestInitializer(ua))
                .setApplicationName(ua.get())
                .build();
    }
@Test
    public void testConnect() throws Exception {
        assertTrue(session.isConnected());
        session.close();
        assertFalse(session.isConnected());
    }