public void testKeyboardInteractiveWithFailures() throws Exception {
final AtomicInteger count = new AtomicInteger();
SshClient client = SshClient.setUpDefaultClient();
client.getProperties().put(ClientFactoryManager.PASSWORD_PROMPTS, "3");
client.setUserAuthFactories(Arrays.<NamedFactory<UserAuth>>asList(new UserAuthKeyboardInteractive.Factory()));
client.setUserInteraction(new UserInteraction() {
public void welcome(String banner) {
}
public String[] interactive(String destination, String name, String instruction, String[] prompt, boolean[] echo) {
count.incrementAndGet();
return new String[] { "bad" };