rewrite post processor; refactoring; tests
diff --git a/src/test/java/IdRewriteTest.java b/src/test/java/IdRewriteTest.java
index be37b7c..8415c2c 100644
--- a/src/test/java/IdRewriteTest.java
+++ b/src/test/java/IdRewriteTest.java
@@ -1,6 +1,9 @@
+import com.fasterxml.jackson.databind.JsonNode;
 import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.resource.rewrite.IdWriter;
 import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
+import de.ids_mannheim.korap.utils.JsonUtils;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -27,6 +30,15 @@
                 BeanConfiguration.getBeans().getConfiguration());
         assert handler.add(IdWriter.class);
 
+        String query = "[surface=Wort]";
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery(query, "poliqarp");
+
+        String value = handler.preProcess(s.toJSON(), null);
+        JsonNode result = JsonUtils.readTree(value);
+
+        assert result != null;
+        assert result.path("query").has("idn");
 
     }