diff options
author | Oleg Mitsura <oleg.mitsura@amdocs.com> | 2019-04-10 22:32:11 -0400 |
---|---|---|
committer | Oleg Mitsura <oleg.mitsura@amdocs.com> | 2019-04-11 08:05:11 -0400 |
commit | 7581c93cbe2aedde587be766628b3a2d5b6258b0 (patch) | |
tree | 5c5d459559b37faa539dc33a4bb2dc6be79f9150 /ms/blueprintsprocessor/functions/netconf-executor/src/test | |
parent | 0c0e1d2e6d5e57a99ff8551a2d7b8e9cdab7d860 (diff) |
netconf-executor: NetconfSessionImplTest improvements
Issue-ID: CCSDK-1126
Change-Id: Ied0360a37f8f22801c63c2aeb70ee73d45cc7b4b
Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/netconf-executor/src/test')
-rw-r--r-- | ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt index 1f526f445..f5fd5410a 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt @@ -168,7 +168,6 @@ class NetconfSessionImplTest { } - @Ignore //TODO undo close method removal @Test fun `disconnect wraps exception from ssh closing error`() { val netconfSessionSpy = spyk(netconfSession, recordPrivateCalls = true) @@ -295,7 +294,6 @@ class NetconfSessionImplTest { } } - @Ignore //TODO revert back on getFutureFromSendMessage @Test fun `syncRpc throws NetconfException if TimeoutException is caught`() { val expectedExceptionMsg = "$deviceInfo: Timed out while waiting for reply for request $formattedRequest after ${deviceInfo.replyTimeout} sec." @@ -310,23 +308,23 @@ class NetconfSessionImplTest { } } - @Ignore @Test fun `syncRpc throws NetconfException if ExecutionException is caught`() { val expectedExceptionMsg = "$deviceInfo: Closing session $sessionId for request $formattedRequest" assertFailsWith(exceptionClass = NetconfException::class, message = expectedExceptionMsg) { - val netconfSessionSpy = spyk(netconfSession) + val netconfSessionSpy = spyk(netconfSession, recordPrivateCalls = false) val futureRet: CompletableFuture<String> = CompletableFuture.completedFuture(futureMsg) every { netconfCommunicator.sendMessage(any(), any()) } returns futureRet every { netconfCommunicator.getFutureFromSendMessage(any(), any(), any()) } throws - ExecutionException("exec exception", Exception("nested exception")) //TODO revert getFutureFromSendMessage back + ExecutionException("exec exception", Exception("nested exception")) + every { netconfSessionSpy["close"]() as Unit } just Runs every { netconfSessionSpy.checkAndReestablish() } just Runs + netconfSessionSpy.setSession(mockClientSession) //call the method netconfSessionSpy.syncRpc("0", "0") } } - @Ignore //TODO revert back on getFutureFromSendMessage @Test fun `syncRpc throws NetconfException if caught ExecutionException and failed to close SSH session`() { val expectedExceptionMsg = "$deviceInfo: Closing session $sessionId for request $formattedRequest" @@ -525,7 +523,6 @@ class NetconfSessionImplTest { verify { mockSshClient.close() } } - @Ignore @Test fun `disconnect wraps IOException if channel doesn't close`() { //this test is equivalent to others every { rpcService.closeSession(false) } returns SUCCESSFUL_DEVICE_RESPONSE |