From 07ce02b937597026a5d7b1468d66a8acb8679e99 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Tue, 8 Jun 2021 02:05:37 +0200 Subject: [PATCH] test: adjusted test to reflect actual requirements --- .../lobby/pipelining/RequestGameLogicSegmentTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/RequestGameLogicSegmentTest.java b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/RequestGameLogicSegmentTest.java index 3f26213..01f3585 100644 --- a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/RequestGameLogicSegmentTest.java +++ b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/RequestGameLogicSegmentTest.java @@ -4,6 +4,8 @@ import org.junit.jupiter.api.Test; import uulm.teamname.marvelous.gamelibrary.events.Event; import uulm.teamname.marvelous.gamelibrary.events.GamestateEvent; import uulm.teamname.marvelous.gamelibrary.gamelogic.GameInstance; +import uulm.teamname.marvelous.gamelibrary.messages.client.RequestMessage; +import uulm.teamname.marvelous.gamelibrary.messages.server.EventMessage; import uulm.teamname.marvelous.gamelibrary.requests.Request; import uulm.teamname.marvelous.gamelibrary.requests.RequestBuilder; import uulm.teamname.marvelous.gamelibrary.requests.RequestType; @@ -31,6 +33,9 @@ class RequestGameLogicSegmentTest { var participant = mock(Participant.class); var packet = new Packet(requests, participant); + var message = new EventMessage(); + message.messages = new Event[] {gamestateEvent}; + when(game.getGameStateEvent()).thenReturn(gamestateEvent); AtomicBoolean abort = new AtomicBoolean(false); @@ -38,8 +43,9 @@ class RequestGameLogicSegmentTest { segment.processRequests(packet, carrier, abort); assertThat(packet).isEmpty(); - assertThat(carrier).containsOnly(gamestateEvent); + assertThat(carrier).isEmpty(); verify(game).getGameStateEvent(); + verify(participant).sendMessage(message); } }