X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fnetconf%2Fnetconf-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fit%2FNetconfITSecureTest.java;h=5f316d11c1cc6e28210d3382d0a78ca23aa01dd6;hb=8f922ab7074dedfb13d5063efa627c475a010293;hp=fdc9a020065be13d5de4268abcfe65c35117a206;hpb=e3631ec58f278e42244bace305818b388c0d5992;p=controller.git diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java index fdc9a02006..5f316d11c1 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java @@ -25,7 +25,6 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.local.LocalAddress; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.concurrent.GlobalEventExecutor; -import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.file.Files; @@ -78,7 +77,6 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { public static final String USERNAME = "user"; public static final String PASSWORD = "pwd"; - private File sshKeyPair; private SshProxyServer sshProxyServer; private ExecutorService nioExec; @@ -87,8 +85,6 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { @Before public void setUp() throws Exception { - sshKeyPair = Files.createTempFile("sshKeyPair", ".pem").toFile(); - sshKeyPair.deleteOnExit(); nioExec = Executors.newFixedThreadPool(1); clientGroup = new NioEventLoopGroup(); minaTimerEx = Executors.newScheduledThreadPool(1); @@ -98,12 +94,13 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { .setBindingAddress(TLS_ADDRESS) .setLocalAddress(NetconfConfigUtil.getNetconfLocalAddress()) .setAuthenticator(new PasswordAuthenticator() { - @Override - public boolean authenticate(final String username, final String password, final ServerSession session) { - return true; - } - }) - .setKeyPairProvider(new PEMGeneratorHostKeyProvider(sshKeyPair.toPath().toAbsolutePath().toString())) + @Override + public boolean authenticate(final String username, final String password, final ServerSession session) { + return true; + } + } + ) + .setKeyPairProvider(new PEMGeneratorHostKeyProvider(Files.createTempFile("prefix", "suffix").toAbsolutePath().toString())) .setIdleTimeout(Integer.MAX_VALUE) .createSshProxyServerConfiguration()); }