# HG changeset patch # User dirk # Date 1316235338 -7200 # Node ID 27bd115e171cf208a5536d04b64b009045c882e9 # Parent 47f6cbd38de3e1cf146c3bf3ba932dc097fbc584 tighten up checks diff -r 47f6cbd38de3 -r 27bd115e171c conflict-editor/src/test/java/de/codedo/conflicteditor/DocumentMatcherTestCase.java --- a/conflict-editor/src/test/java/de/codedo/conflicteditor/DocumentMatcherTestCase.java Sat Sep 17 06:49:13 2011 +0200 +++ b/conflict-editor/src/test/java/de/codedo/conflicteditor/DocumentMatcherTestCase.java Sat Sep 17 06:55:38 2011 +0200 @@ -2,7 +2,6 @@ package de.codedo.conflicteditor; import static de.codedo.conflicteditor.matchers.ObjectEqualityMatcher.isEqualTo; - import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; @@ -60,9 +59,14 @@ public void valuePresentOnlyInConflictShouldProduceDifference() throws Exception { JsonNode original = parse("{ 'key' : 'value' }"); - JsonNode conflict = parse("{ 'key' : 'value', 'only-here' : 'test' }"); + JsonNode conflict = parse("{ 'key' : 'value', 'only-here' : 'value' }"); List diffs = new DocumentMatcher(original, conflict).compare(); assertThat(diffs, hasSize(1)); + + Difference diff = diffs.get(0); + assertThat(diff.key, is("only-here")); + assertThat(diff.currentValue, is(nullValue())); + assertThat(diff.otherValue, isEqualTo("value")); } private JsonNode parse(String input) throws IOException