model/src/test/java/eu/internetofus/common/model/MergesTest.java
/**
   * Check can merge JSON object values.
   *
   * @see Merges#mergeValues(Object,Object)
   */
Check can merge JSON object values.
Check can merge JSON object values .
@Test
  public void shoulMergeJsonObjectValues() {
    final var source = new JsonObject();
    source.put("source", "source");
    assertThat(Merges.mergeValues(null, source)).isSameAs(source);
    assertThat(Merges.mergeValues(1l, source)).isSameAs(source);
    final var target = new JsonObject();
    target.put("target", "target");
    assertThat(Merges.mergeValues(target, null)).isSameAs(target);
    final var merged = new JsonObject();
    merged.put("target", "target");
    merged.put("source", "source");
    assertThat(Merges.mergeValues(target, source)).isEqualTo(merged).isNotSameAs(target).isNotSameAs(source);
  }
@ Test public void shoulMergeJsonObjectValues ( ) { final var source = new JsonObject ( ) ; source . put ( "source" , "source" ) ; assertThat ( Merges . mergeValues ( null , source ) ) . isSameAs ( source ) ; assertThat ( Merges . mergeValues ( 1l , source ) ) . isSameAs ( source ) ; final var target = new JsonObject ( ) ; target . put ( "target" , "target" ) ; assertThat ( Merges . mergeValues ( target , null ) ) . isSameAs ( target ) ; final var merged = new JsonObject ( ) ; merged . put ( "target" , "target" ) ; merged . put ( "source" , "source" ) ; assertThat ( Merges . mergeValues ( target , source ) ) . isEqualTo ( merged ) . isNotSameAs ( target ) . isNotSameAs ( source ) ; }
Check can merge JSON object values.
Check can merge JSON object values .