+
+ public NetconfClientConfiguration getClientConfiguration() throws IOException {
+ final NetconfClientConfigurationBuilder b = NetconfClientConfigurationBuilder.create();
+ b.withAddress(tlsAddress);
+ b.withSessionListener(new SimpleNetconfClientSessionListener());
+ b.withReconnectStrategy(new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, 5000));
+ b.withProtocol(NetconfClientConfiguration.NetconfClientProtocol.SSH);
+ b.withConnectionTimeoutMillis(5000);
+ b.withAuthHandler(getAuthHandler());
+ return b.build();
+ }
+
+ public AuthProvider getAuthProvider() throws Exception {
+ AuthProvider mock = mock(AuthProviderImpl.class);
+ doReturn(true).when(mock).authenticated(anyString(), anyString());
+ doReturn(PEMGenerator.generate().toCharArray()).when(mock).getPEMAsCharArray();
+ return mock;
+ }
+
+ public AuthenticationHandler getAuthHandler() throws IOException {
+ return new LoginPassword("user", "pwd");
+ }