From e1673a47f525d4b72ddee0a97e17bb3ef0d04424 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Thu, 9 Nov 2023 08:05:09 -0700 Subject: [PATCH] start adding tests for toObjectNode that is problematic with new memo with json --- .../domain/extensions/ExtenstionsKtTest.kt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 service/src/test/kotlin/io/provenance/explorer/domain/extensions/ExtenstionsKtTest.kt diff --git a/service/src/test/kotlin/io/provenance/explorer/domain/extensions/ExtenstionsKtTest.kt b/service/src/test/kotlin/io/provenance/explorer/domain/extensions/ExtenstionsKtTest.kt new file mode 100644 index 00000000..34a46938 --- /dev/null +++ b/service/src/test/kotlin/io/provenance/explorer/domain/extensions/ExtenstionsKtTest.kt @@ -0,0 +1,32 @@ +package io.provenance.explorer.domain.extensions + +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.Assertions.* +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.node.ObjectNode +import org.apache.commons.lang3.StringEscapeUtils + +class ExtensionsKtTest { + + @Test + fun toObjectNode() { +// // Given an input JSON string +// val inputJson = "{\"key\":\"value\"}" +// +// // Create an ObjectMapper for testing +// val objectMapper = ObjectMapper() +// +// // Escape the input JSON +// val escapedInput = StringEscapeUtils.escapeJson(inputJson) +// +// // Convert the escaped JSON to an ObjectNode +// val resultObjectNode = escapedInput.toObjectNode(objectMapper) +// +// // Create an expected ObjectNode +// val expectedObjectNode = objectMapper.createObjectNode() +// expectedObjectNode.put("key", "value") +// +// // Assert that the result ObjectNode is equal to the expected ObjectNode +// assertEquals(expectedObjectNode, resultObjectNode) + } +} \ No newline at end of file