Fix sonar issue NetconfMessageListenerTest 45/106345/1
authorAleksandra Maciaga <aleksandra.maciaga@nokia.com>
Tue, 21 Apr 2020 11:39:45 +0000 (13:39 +0200)
committerAleksandra Maciaga <aleksandra.maciaga@nokia.com>
Tue, 21 Apr 2020 11:39:45 +0000 (13:39 +0200)
Tests should include assertions

A test case without assertions ensures only that no exceptions are thrown. Beyond basic runnability, it ensures nothing about the behavior of the code under test.

Issue-ID: INT-1517
Signed-off-by: Aleksandra Maciaga <aleksandra.maciaga@nokia.com>
Change-Id: I0f60482a6db2e24b23630c88bf13264c4d6fbbd6

netconfsimulator/src/test/java/org/onap/netconfsimulator/websocket/message/NetconfMessageListenerTest.java

index bb040d1..c6e58c9 100644 (file)
@@ -69,5 +69,7 @@ class NetconfMessageListenerTest {
         doThrow(new EncodeException("","")).when(remoteEndpoint).sendObject(any(KafkaMessage.class));
 
         netconfMessageListener.onMessage(KAFKA_RECORD);
+        
+        verify(remoteEndpoint).sendObject(any(KafkaMessage.class));
     }
 }