@Test(expected = LoginCanceledException.class) public void testWarn() throws Exception { new TerminalLoginCallback(new TerminalPromptReader() { @Override public boolean prompt(final String message) { return false; } }).warn(new Host(new TestProtocol()), "", "", "", "", ""); }
@Override public void warn(final Host bookmark, final String title, final String reason, final String defaultButton, final String cancelButton, final String preference) throws ConnectionCanceledException { console.printf("%n%s", reason); if(!prompt.prompt(String.format("%s (y) or %s (n): ", defaultButton, cancelButton))) { throw new LoginCanceledException(); } }
TerminalLoginCallback extends TerminalPasswordCallback implements LoginCallback { @Override public void warn(final Host bookmark, final String title, final String reason, final String defaultButton, final String cancelButton, final String preference) throws ConnectionCanceledException { console.printf("%n%s", reason); if(!prompt.prompt(String.format("%s (y) or %s (n): ", defaultButton, cancelButton))) { throw new LoginCanceledException(); } } }
TerminalLoginCallback extends TerminalPasswordCallback implements LoginCallback { @Override public void warn(final Host bookmark, final String title, final String reason, final String defaultButton, final String cancelButton, final String preference) throws ConnectionCanceledException { console.printf("%n%s", reason); if(!prompt.prompt(String.format("%s (y) or %s (n): ", defaultButton, cancelButton))) { throw new LoginCanceledException(); } } TerminalLoginCallback();  TerminalLoginCallback(final TerminalPromptReader prompt); }
TerminalLoginCallback extends TerminalPasswordCallback implements LoginCallback { @Override public void warn(final Host bookmark, final String title, final String reason, final String defaultButton, final String cancelButton, final String preference) throws ConnectionCanceledException { console.printf("%n%s", reason); if(!prompt.prompt(String.format("%s (y) or %s (n): ", defaultButton, cancelButton))) { throw new LoginCanceledException(); } } TerminalLoginCallback();  TerminalLoginCallback(final TerminalPromptReader prompt); @Override void warn(final Host bookmark, final String title, final String reason,
                     final String defaultButton, final String cancelButton, final String preference); @Override Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options); @Override Local select(final Local identity); }
TerminalLoginCallback extends TerminalPasswordCallback implements LoginCallback { @Override public void warn(final Host bookmark, final String title, final String reason, final String defaultButton, final String cancelButton, final String preference) throws ConnectionCanceledException { console.printf("%n%s", reason); if(!prompt.prompt(String.format("%s (y) or %s (n): ", defaultButton, cancelButton))) { throw new LoginCanceledException(); } } TerminalLoginCallback();  TerminalLoginCallback(final TerminalPromptReader prompt); @Override void warn(final Host bookmark, final String title, final String reason,
                     final String defaultButton, final String cancelButton, final String preference); @Override Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options); @Override Local select(final Local identity);  }