Eddy Young
2015-05-22 410c92f5c71c93cd2b4b0a1d9ee4067c34b80c66
src/test/java/com/gitblit/tests/SshUnitTest.java
@@ -24,13 +24,18 @@
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PublicKey;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.sshd.ClientChannel;
import org.apache.sshd.ClientSession;
import org.apache.sshd.SshClient;
import org.apache.sshd.client.ServerKeyVerifier;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.util.SecurityUtils;
import org.apache.sshd.client.UserAuth;
import org.apache.sshd.client.auth.UserAuthPublicKey;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -102,6 +107,9 @@
            return true;
         }
      });
      List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<>();
      userAuthFactories.add(new UserAuthPublicKey.Factory());
      client.setUserAuthFactories(userAuthFactories);
      client.start();
      return client;
   }