package org.opendaylight.netconf.impl;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.verify;
final Session managementSession = this.session.toManagementSession();
this.session.onIncommingRpcSuccess();
final Session afterRpcSuccess = this.session.toManagementSession();
- Assert.assertEquals(managementSession.getInRpcs().getValue() + 1,
+ Assert.assertEquals(managementSession.getInRpcs().getValue().toJava() + 1,
afterRpcSuccess.getInRpcs().getValue().longValue());
}
final Session managementSession = this.session.toManagementSession();
this.session.onIncommingRpcFail();
final Session afterRpcSuccess = this.session.toManagementSession();
- Assert.assertEquals(managementSession.getInBadRpcs().getValue() + 1,
+ Assert.assertEquals(managementSession.getInBadRpcs().getValue().toJava() + 1,
afterRpcSuccess.getInBadRpcs().getValue().longValue());
}
final Session managementSession = this.session.toManagementSession();
this.session.onOutgoingRpcError();
final Session afterRpcSuccess = this.session.toManagementSession();
- Assert.assertEquals(managementSession.getOutRpcErrors().getValue() + 1,
+ Assert.assertEquals(managementSession.getOutRpcErrors().getValue().toJava() + 1,
afterRpcSuccess.getOutRpcErrors().getValue().longValue());
}
final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
tcpSession.sessionUp();
final Session managementSession = tcpSession.toManagementSession();
- Assert.assertEquals(new String(managementSession.getSourceHost().getValue()), HOST);
+ Assert.assertEquals(HOST, managementSession.getSourceHost().getIpAddress().getIpv4Address().getValue());
Assert.assertEquals(managementSession.getUsername(), USER);
Assert.assertEquals(managementSession.getSessionId().toString(), SESSION_ID);
Assert.assertEquals(managementSession.getTransport(), NetconfTcp.class);
final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
tcpSession.sessionUp();
tcpSession.toManagementSession();
+ tcpSession.close();
}
@Test
final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
tcpSession.sessionUp();
final Session managementSession = tcpSession.toManagementSession();
- Assert.assertEquals(new String(managementSession.getSourceHost().getValue()), "::1");
+ Assert.assertEquals("::1", managementSession.getSourceHost().getIpAddress().getIpv6Address().getValue());
Assert.assertEquals(managementSession.getUsername(), USER);
Assert.assertEquals(managementSession.getSessionId().toString(), SESSION_ID);
Assert.assertEquals(managementSession.getTransport(), NetconfSsh.class);