diff --git a/src/test/java/dev/lukebemish/codecextras/test/CodecAssertions.java b/src/test/java/dev/lukebemish/codecextras/test/CodecAssertions.java index 0d84247..8044ffd 100644 --- a/src/test/java/dev/lukebemish/codecextras/test/CodecAssertions.java +++ b/src/test/java/dev/lukebemish/codecextras/test/CodecAssertions.java @@ -20,7 +20,7 @@ public static void assertDecodes(DynamicOps jsonOps, String jso public static void assertDecodes(DynamicOps ops, T data, O expected, Codec codec) { DataResult dataResult = codec.parse(ops, data); Assertions.assertTrue(dataResult.result().isPresent()); - Assertions.assertEquals(dataResult.result().get(), expected); + Assertions.assertEquals(expected, dataResult.result().get()); } public static void assertEncodes(DynamicOps jsonOps, O value, String json, Codec codec) { @@ -32,7 +32,7 @@ public static void assertEncodes(DynamicOps jsonOps, O value, S public static void assertEncodes(DynamicOps ops, O value, T expected, Codec codec) { DataResult dataResult = codec.encodeStart(ops, value); Assertions.assertTrue(dataResult.result().isPresent()); - Assertions.assertEquals(dataResult.result().get(), expected); + Assertions.assertEquals(expected, dataResult.result().get()); } public static void assertJsonEquals(String expected, String actual) { diff --git a/src/test/java/dev/lukebemish/codecextras/test/mutalbe/TestDataElements.java b/src/test/java/dev/lukebemish/codecextras/test/mutalbe/TestDataElements.java index 2b0c770..4f4df8c 100644 --- a/src/test/java/dev/lukebemish/codecextras/test/mutalbe/TestDataElements.java +++ b/src/test/java/dev/lukebemish/codecextras/test/mutalbe/TestDataElements.java @@ -38,24 +38,15 @@ public int hashCode() { } private final String both = """ - [ - { - "index": 0, - "value": "Hello" - }, - { - "index": 1, - "value": 42 - } - ]"""; + { + "string": "Hello", + "integer": 42 + }"""; private final String onlyChanged = """ - [ - { - "index": 1, - "value": 42 - } - ]"""; + { + "integer": 42 + }"""; @Test void testEncodeMutable() {