Package de.danielbechler.diff.selector

Examples of de.danielbechler.diff.selector.MapKeyElementSelector


    working.put("foo", "bar");

    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);

    NodeAssertions.assertThat(node).self().hasState(DiffNode.State.ADDED);
    NodeAssertions.assertThat(node).child(new MapKeyElementSelector("foo")).hasState(DiffNode.State.ADDED);
  }
View Full Code Here


    working.put("foo", "bar");

    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);

    NodeAssertions.assertThat(node).self().hasState(DiffNode.State.CHANGED);
    NodeAssertions.assertThat(node).child(new MapKeyElementSelector("foo")).hasState(DiffNode.State.ADDED);
  }
View Full Code Here

    final Map<String, String> working = null;

    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);

    NodeAssertions.assertThat(node).self().hasState(DiffNode.State.REMOVED);
    NodeAssertions.assertThat(node).child(new MapKeyElementSelector("foo")).hasState(DiffNode.State.REMOVED);
  }
View Full Code Here

    final Map<String, String> base = new LinkedHashMap<String, String>(1);
    base.put("foo", "woot");

    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);
    NodeAssertions.assertThat(node).self().hasChildren(1);
    NodeAssertions.assertThat(node).child(new MapKeyElementSelector("foo")).hasState(DiffNode.State.CHANGED);
  }
View Full Code Here

  @Test
  public void testWithMapKey()
  {
    final NodePath nodePath = NodePath.startBuilding().mapKey("foo").build();
    assertThat(nodePath.getElementSelectors()).containsSequence(RootElementSelector.getInstance(), new MapKeyElementSelector("foo"));
  }
View Full Code Here

    return "map key " + getElementSelector();
  }

  public ElementSelector getElementSelector()
  {
    return new MapKeyElementSelector(referenceKey);
  }
View Full Code Here

    }

    public <K> AppendableBuilder mapKey(final K key)
    {
      Assert.notNull(key, "key");
      elementSelectors.add(new MapKeyElementSelector(key));
      return this;
    }
View Full Code Here

TOP

Related Classes of de.danielbechler.diff.selector.MapKeyElementSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.