+ @Test
+ fun `get completes normally`() {
+ val netconfRpcService = NetconfRpcServiceImpl(deviceInfo)
+ netconfRpcService.setNetconfSession(mockNetconfSession)
+ val spy = spyk(netconfRpcService)
+ every { spy.asyncRpc(any(), any()) } returns successfulDeviceResponse
+ val getRpcrResult = spy.get(someString)
+ assertEquals(successfulDeviceResponse, getRpcrResult)
+ }
+
+ @Test
+ fun `get on error sets DeviceResponse status to FAILURE`() {
+ val netconfRpcService = NetconfRpcServiceImpl(deviceInfo)
+ netconfRpcService.setNetconfSession(mockNetconfSession)
+ val spy = spyk(netconfRpcService)
+ every { spy.asyncRpc(any(), any()) } throws IOException("Some IO exception...")
+ val getRpcResult = spy.get(someString)
+ assertEquals(failedDeviceResponse.status, getRpcResult.status)
+ assertTrue { getRpcResult.errorMessage!!.contains("failed in 'get' command") }
+ }
+