feat: partial rewrite of JSON wit support for CharacterConfig

This commit is contained in:
2021-05-31 23:24:22 +02:00
parent c8d34fcc97
commit 852c85df08
2 changed files with 36 additions and 8 deletions

View File

@ -34,6 +34,9 @@ class JSONTest {
/** Still need to add: messages, messageType */
EventMessage target;
JSON json;
// TODO: add proper CharacterConfig, otherwise Character events won't be deserializable
@BeforeEach
void setUp() {
messageStructureStart = """
@ -69,6 +72,9 @@ class JSONTest {
target.customContent.put("customKey", "customResult");
target.customContent.put("customNumber", 15);
target.customContent.put("customProperty", true);
this.json = new JSON(null);
// FIXME: Temporary hotfix, nothing valid yet
}
@AfterEach
@ -91,7 +97,7 @@ class JSONTest {
target.messageType = MessageType.EVENTS;
target.messages = targetEvents;
assertThat(JSON.parse(completeMessageStructure)).isEqualTo(target);
assertThat(json.parse(completeMessageStructure)).isEqualTo(target);
}
@ -113,7 +119,7 @@ class JSONTest {
""";
String completeMessageStructure = messageStructureStart + eventRepresentation + messageStructureEnd[1];
System.out.println(JSON.parse(completeMessageStructure));
System.out.println(json.parse(completeMessageStructure));
}
@Test