feat: partial rewrite of JSON wit support for CharacterConfig
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user