Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gmahadevan committed Aug 27, 2024
1 parent b4a0689 commit 6f35e5f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/test/java/com/snowflake/snowpark_test/JavaVariantSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,10 @@ public void equalsAndToString() {

@Test
public void javaJsonNodeVariantConverter() throws IllegalArgumentException {
// Scala variant to Java Variant
com.snowflake.snowpark.types.Variant sv =
new com.snowflake.snowpark.types.Variant(
"{\"name\": \"abc\",\"grade\": 2, \"Interest\": \"cricket\"}");
Variant jResult = InternalUtils.createVariant(sv);
JsonNode jsonNode = jResult.asJsonNode();
Variant jv = new Variant("{\"a\": [1, 2], \"b\": \"c\"}");
JsonNode jNode = jv.asJsonNode();

assert jsonNode.get("name").asText().equals("abc");
assert jsonNode.get("grade").asInt() == 2;
assert (jNode.get("a").isArray());
assert (jNode.get("b").asText().equals("c"));
}
}

0 comments on commit 6f35e5f

Please sign in to comment.