@Test public void mergeDefinitions_PreservesFieldsNotDefinedInReplacement() throws Exception { JsonNode sourceDefinitions = mapper.readTree("{\"foo\": \"bar\", \"fields\": \"[{\\\"name\\\":\\\"sourceField\\\"}]\", \"fieldFormatMap\": \"{\\\"foo\\\": {\\\"name\\\": \\\"sourceFieldFormatMap\\\"}}\"}"); JsonNode stagemonitorDefinitions = mapper.readTree("{\"fields\": \"[]\", \"fieldFormatMap\": \"{}\"}"); JsonNode resultDefinitions = JsonMerger.merge(sourceDefinitions, stagemonitorDefinitions, mergeStrategy); assertThat(resultDefinitions.get("foo").textValue()).isEqualTo("bar"); assertThat(mapper.readTree(resultDefinitions.get("fields").textValue())) .isEqualTo(mapper.readTree(sourceDefinitions.get("fields").textValue())); assertThat(mapper.readTree(resultDefinitions.get("fieldFormatMap").textValue())) .isEqualTo(mapper.readTree(sourceDefinitions.get("fieldFormatMap").textValue())); }
public static JsonNode merge(JsonNode source, JsonNode replacement) throws IOException { return new MergeStrategy().execute(source, replacement); }
JsonMerger { public static JsonNode merge(JsonNode source, JsonNode replacement) throws IOException { return new MergeStrategy().execute(source, replacement); } }
JsonMerger { public static JsonNode merge(JsonNode source, JsonNode replacement) throws IOException { return new MergeStrategy().execute(source, replacement); }  }
JsonMerger { public static JsonNode merge(JsonNode source, JsonNode replacement) throws IOException { return new MergeStrategy().execute(source, replacement); }  static JsonNode merge(JsonNode source, JsonNode replacement); static JsonNode merge(JsonNode source, JsonNode replacement, MergeStrategy mergeStrategy); static MergeStrategy mergeStrategy(); }
JsonMerger { public static JsonNode merge(JsonNode source, JsonNode replacement) throws IOException { return new MergeStrategy().execute(source, replacement); }  static JsonNode merge(JsonNode source, JsonNode replacement); static JsonNode merge(JsonNode source, JsonNode replacement, MergeStrategy mergeStrategy); static MergeStrategy mergeStrategy();  }