Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
import org.apache.hadoop.io.Text;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

public class LoadPlanTest {
@Test
public void testBadRange1() {
Expand Down Expand Up @@ -112,7 +115,7 @@ public void testTypes() {
}

@Test
public void testJson() {
public void testJson() throws Exception {
var loadPlan = LoadPlan.builder().build();
assertEquals(0, loadPlan.getDestinations().size());
assertEquals("{\"destinations\":[]}", loadPlan.toJson());
Expand All @@ -137,7 +140,11 @@ public void testJson() {
+ "','endRow':'" + b64006 + "','rangeType':'TABLE'},{'fileName':'f3.rf','startRow':'"
+ b64binary + "','endRow':null,'rangeType':'TABLE'}]}";

assertEquals(expected.replace("'", "\""), json);
ObjectMapper mapper = new ObjectMapper();
JsonNode node1 = mapper.readTree(expected.replace("'", "\""));
JsonNode node2 = mapper.readTree(json);

assertEquals(node1, node2);
}

@Test
Expand Down