changeset 17:27bd115e171c

tighten up checks
author dirk
date Sat, 17 Sep 2011 06:55:38 +0200
parents 47f6cbd38de3
children c621a437ace5
files conflict-editor/src/test/java/de/codedo/conflicteditor/DocumentMatcherTestCase.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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<Difference> 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