summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/netconf-executor
diff options
context:
space:
mode:
authorEliezio Oliveira <eliezio.oliveira@est.tech>2019-06-04 22:58:35 +0100
committerEliezio Oliveira <eliezio.oliveira@est.tech>2019-07-08 11:27:20 +0100
commit11133da337c493fbef734e1961d800f4d2ae1aaf (patch)
tree508bf713c296cbfed1d6382fa298bd5d30142633 /ms/blueprintsprocessor/functions/netconf-executor
parent0ddc8914d59c697624f5bba2cb0c0de66641c9e2 (diff)
Re-enabled @Ignored tests on NetconfSessionImplTest
Change-Id: I7d223956c95d4effc6a6d6c4cc3bf6648ada28be Issue-ID: CCSDK-1451 Signed-off-by: Eliezio Oliveira <eliezio.oliveira@est.tech>
Diffstat (limited to 'ms/blueprintsprocessor/functions/netconf-executor')
-rw-r--r--ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt26
1 files changed, 13 insertions, 13 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 f5fd5410a..7f6c8d390 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
@@ -32,7 +32,6 @@ import org.apache.sshd.client.future.DefaultOpenFuture
import org.apache.sshd.client.session.ClientSession
import org.apache.sshd.common.FactoryManager
import org.junit.Before
-import org.junit.Ignore
import org.junit.Test
import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo
import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceResponse
@@ -278,7 +277,6 @@ class NetconfSessionImplTest {
verify(exactly = 1) { netconfSessionSpy.clearReplies() }
}
- @Ignore //TODO
//Test for handling CompletableFuture.get returns InterruptedException inside NetconfDeviceCommunicator
@Test
fun `syncRpc throws NetconfException if InterruptedException is caught`() {
@@ -360,19 +358,21 @@ class NetconfSessionImplTest {
}
@Test
- @Ignore
- //TODO: get 't' inside asyncRpc to be a Throwable
fun `asyncRpc wraps exception`() {
- assertFailsWith(exceptionClass = NetconfException::class, message = futureMsg) {
- val netconfSessionSpy = spyk(netconfSession)
- val futureRet: CompletableFuture<String> = CompletableFuture.supplyAsync {
- throw Exception("blah")
- }
- futureRet.completeExceptionally(IOException("something is wrong"))
- every { netconfCommunicator.sendMessage(any(), any()) } returns futureRet
- //RUN
- val rpcResultFuture = netconfSessionSpy.asyncRpc("0", "0")
+ val netconfSessionSpy = spyk(netconfSession)
+ every { netconfSessionSpy.checkAndReestablish() } just Runs
+ val futureRet: CompletableFuture<String> = CompletableFuture.supplyAsync {
+ throw Exception("blah")
+ }
+ every { netconfCommunicator.sendMessage(any(), any()) } returns futureRet
+ //run the method
+ val rpcResultFuture = netconfSessionSpy.asyncRpc("0", "0")
+ every { netconfSessionSpy.checkAndReestablish() } just Runs
+ val e = assertFailsWith(exceptionClass = ExecutionException::class, message = futureMsg) {
+ rpcResultFuture.get()
}
+ val cause = e.cause
+ assertTrue { cause is NetconfException }
}
@Test