fix: fixed GamestateEvent deserialization test
This commit is contained in:
parent
156677f290
commit
c5fe7ec7db
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user