diff options
Diffstat (limited to 'org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit')
4 files changed, 29 insertions, 12 deletions
diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java index 0ad96b9acf..eef0402b07 100644 --- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java +++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java @@ -26,12 +26,15 @@ public class ApacheSshProtocol2Test extends SshBasicTestBase { @Override protected SshSessionFactory createSessionFactory() { - SshdSessionFactory result = new SshdSessionFactory(new JGitKeyCache(), - null); - // The home directory is mocked at this point! - result.setHomeDirectory(FS.DETECTED.userHome()); - result.setSshDirectory(sshDir); - return result; + return new SshdSessionFactoryBuilder() + // No proxies in tests + .setProxyDataFactory(null) + // No ssh-agent in tests + .setConnectorFactory(null) + // The home directory is mocked at this point! + .setHomeDirectory(FS.DETECTED.userHome()) + .setSshDirectory(sshDir) + .build(new JGitKeyCache()); } @Override diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java index c1f5fef3cd..85626d8ee3 100644 --- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java +++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java @@ -65,12 +65,15 @@ public class ApacheSshTest extends SshTestBase { @Override protected SshSessionFactory createSessionFactory() { - SshdSessionFactory result = new SshdSessionFactory(new JGitKeyCache(), - null); - // The home directory is mocked at this point! - result.setHomeDirectory(FS.DETECTED.userHome()); - result.setSshDirectory(sshDir); - return result; + return new SshdSessionFactoryBuilder() + // No proxies in tests + .setProxyDataFactory(null) + // No ssh-agent in tests + .setConnectorFactory(null) + // The home directory is mocked at this point! + .setHomeDirectory(FS.DETECTED.userHome()) + .setSshDirectory(sshDir) + .build(new JGitKeyCache()); } @Override diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshBuilderTest.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshBuilderTest.java index 9d64adc95e..fd51e0cf47 100644 --- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshBuilderTest.java +++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshBuilderTest.java @@ -50,6 +50,10 @@ public class NoFilesSshBuilderTest extends SshTestHarness { @Override protected SshSessionFactory createSessionFactory() { return new SshdSessionFactoryBuilder() // + // No proxies in tests + .setProxyDataFactory(null) + // No ssh-agent in tests + .setConnectorFactory(null) .setConfigStoreFactory((h, f, u) -> null) .setDefaultKeysProvider(f -> new KeyAuthenticator()) .setServerKeyDatabase((h, s) -> new ServerKeyDatabase() { diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshTest.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshTest.java index 7b6e508c31..04c1c605d8 100644 --- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshTest.java +++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/NoFilesSshTest.java @@ -33,6 +33,7 @@ import org.eclipse.jgit.junit.ssh.SshTestHarness; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.SshSessionFactory; +import org.eclipse.jgit.transport.sshd.agent.ConnectorFactory; import org.eclipse.jgit.util.FS; import org.junit.After; import org.junit.Test; @@ -81,6 +82,12 @@ public class NoFilesSshTest extends SshTestHarness { } @Override + protected ConnectorFactory getConnectorFactory() { + // No ssh-agent in tests + return null; + } + + @Override protected Iterable<KeyPair> getDefaultKeys(File dir) { // This would work for this simple test case: // return Collections.singletonList(testUserKey); |