diff --git a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java index e3ea747..5923971 100644 --- a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java +++ b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java @@ -2,9 +2,11 @@ package uulm.teamname.marvelous.server.lobby.pipelining; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import uulm.teamname.marvelous.gamelibrary.messages.ParticipantType; import uulm.teamname.marvelous.gamelibrary.requests.Request; import uulm.teamname.marvelous.gamelibrary.requests.RequestBuilder; import uulm.teamname.marvelous.gamelibrary.requests.RequestType; +import uulm.teamname.marvelous.server.lobbymanager.Participant; import static org.junit.jupiter.api.Assertions.*; import static org.assertj.core.api.Assertions.*; @@ -39,5 +41,16 @@ class PacketTest { assertThat(packet).containsOnly(new RequestBuilder(RequestType.Req).buildGameRequest()); } - //TODO: test getOrigin(); + @Test + void getOriginTest(){ + var requests = new Request[] { + new RequestBuilder(RequestType.Req).buildGameRequest(), + new RequestBuilder(RequestType.MoveRequest).buildGameRequest() + }; + var participant = new Participant(null, ParticipantType.PlayerOne, "PlaerOne"); + packet = new Packet(requests, participant); + + assertThat(packet.getOrigin()).isEqualTo(participant); + } + } \ No newline at end of file