collection duplicate test
Change-Id: I91618aa5538857072cdfac228d3c7b0a49903dbd
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java
new file mode 100644
index 0000000..c655c9a
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java
@@ -0,0 +1,32 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * @author hanl
+ * @date 28/07/2015
+ */
+public class CollectionQueryDuplicateTest {
+
+ @Test
+ public void testCollectionQueryDuplicateThrowsNoException() {
+ QuerySerializer serializer = new QuerySerializer();
+ serializer.setQuery("[base=Haus]", "poliqarp");
+ serializer.setCollection("textClass=politik & corpusID=WPD");
+ ObjectMapper m = new ObjectMapper();
+ try {
+ JsonNode first = m.readTree(serializer.toJSON());
+ JsonNode second = m.readTree(serializer.toJSON());
+
+ assert first.at("/collection").equals(second.at("/collection"));
+
+ }catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}