From 9f120b63176a7c6b0e9b5f3154c682a1570c4844 Mon Sep 17 00:00:00 2001 From: Thibaud Date: Mon, 27 Jan 2020 21:50:39 +0100 Subject: [PATCH] messaging/broker : update test cases See c4477aca38 --- .../messagebroker/handlers/AddHandlerMessageHandlerTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/messaging/src/test/java/messagebroker/handlers/AddHandlerMessageHandlerTest.java b/messaging/src/test/java/messagebroker/handlers/AddHandlerMessageHandlerTest.java index f93381a..8a7a713 100644 --- a/messaging/src/test/java/messagebroker/handlers/AddHandlerMessageHandlerTest.java +++ b/messaging/src/test/java/messagebroker/handlers/AddHandlerMessageHandlerTest.java @@ -5,6 +5,8 @@ import messagebroker.MessageHandlerContext; import messagebroker.UnknownMessageFormatException; import org.junit.Test; +import java.io.OutputStream; + import static org.mockito.Mockito.*; public class AddHandlerMessageHandlerTest { @@ -19,6 +21,7 @@ public class AddHandlerMessageHandlerTest { @Test public void shouldHandleMessageWithAddHandlerPattern() throws ReflectiveOperationException, UnknownMessageFormatException { var handlerName = "AnHandler"; + when(context.getOutputStream()).thenReturn(mock(OutputStream.class)); AddHandlerMessageHandler handler = new AddHandlerMessageHandler(context); handler.handleMessage("CONTROL.ADD_HANDLER " + handlerName); verify(context.getBroker()).addHandler(handlerName);