Do no use Optional to pass down null 30/100730/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 21 Apr 2022 15:10:21 +0000 (17:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 23 Apr 2022 04:17:07 +0000 (06:17 +0200)
We have a complicated way of passing null to tested method, fix that.

Change-Id: I10e7c5a812d0b5cdc3b29130d15418d5e5ac7971
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6dde3cf1413807b8e5d4f80cf1f91b10a81c2261)

pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPTopologySessionListenerTest.java

index f2cedfff0647246321d7e9d6154b6b6806605670..d15d4cd8eef36e21870b76ca58e5314c9ab39ae3 100644 (file)
@@ -283,9 +283,7 @@ public class PCEPTopologySessionListenerTest extends AbstractPCEPSessionTest {
     public void testOnUnhandledErrorMessage() {
         final Message errorMsg = AbstractMessageParser.createErrorMsg(PCEPErrors.NON_ZERO_PLSPID, Optional.empty());
         listener.onSessionUp(session);
-        assertTrue(listener.onMessage(Optional.<AbstractTopologySessionListener.MessageContext>empty()
-                .orElse(null),
-            errorMsg));
+        assertTrue(listener.onMessage((AbstractTopologySessionListener.MessageContext) null, errorMsg));
     }
 
     @Test