From c5fe7ec7dbbefea8d9e4ec49c2897c22c728344e Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Mon, 17 May 2021 18:48:58 +0200 Subject: [PATCH] fix: fixed GamestateEvent deserialization test --- .../json/ingame/EventDeserializerTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/test/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializerTest.java b/src/test/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializerTest.java index b48d71a..856acc3 100644 --- a/src/test/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializerTest.java +++ b/src/test/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializerTest.java @@ -124,30 +124,31 @@ class EventDeserializerTest { gamestate.winCondition = true; + var jsonRepresentingGamestate = """ { "eventType": "GamestateEvent", "entities": [ { "entityType": "Character", - "Name": "Alpha", + "name": "Alpha", "PID": 1, "ID": 4, "HP": 210, "MP": 9, "AP": 3, - "Stones": [1, 4], + "stones": [1, 4], "position": [4, 2] }, { "entityType": "Character", - "Name": "Steel Wall", + "name": "Steel Wall", "PID": 1, "ID": 4, "HP": 123, "MP": 2, "AP": 21, - "Stones": [], + "stones": [], "position": [6, 7] }, { @@ -182,7 +183,11 @@ class EventDeserializerTest { } """; - assertThat((GamestateEvent) mapper.readValue(jsonRepresentingGamestate, GamestateEvent.class)) + System.out.println("=== DEBUG OUTPUT ===\n" + + mapper.readValue(jsonRepresentingGamestate, Event.class) + + "\n===================="); + + assertThat((GamestateEvent) mapper.readValue(jsonRepresentingGamestate, Event.class)) .withFailMessage("GamestateEvent was not properly deserialized") .isEqualTo(gamestate); }