public Credentials pair(final Host bookmark, final ConnectionCallback alert, final LoginCallback prompt, final CancelCallback cancel,
                            final String title, final String message) throws BackgroundException {
        return this.pair(bookmark, alert, prompt, cancel, title, message, BrowserLauncherFactory.get());
    }
@Test(expected = ConnectionCanceledException.class)
    public void testLoginInterrupt() throws Exception {
        final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BrickProtocol())));
        final Profile profile = new ProfilePlistReader(factory).read(
                this.getClass().getResourceAsStream("/Brick.cyberduckprofile"));
        final Host host = new Host(profile, "mountainduck.files.com") {
            @Override
            public String getProperty(final String key) {
                switch(key) {
                    case "brick.pairing.interval.ms":
                        return String.valueOf(100L);
                    case "brick.pairing.interrupt.ms":
                        return String.valueOf(1000L);
                }
                return super.getProperty(key);
            }
        };
        final BrickSession session = new BrickSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
        session.pair(host, new DisabledConnectionCallback(), new DisabledLoginCallback(), new DisabledCancelCallback(),
                "t", "m", new BrowserLauncher() {
                    @Override
                    public boolean open(final String url) {
                        return true;
                    }
                });
    }