diff --git a/core/Changes b/core/Changes
index 210c625..ee3b3cb 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,6 +1,8 @@
 # version 0.61.5
-17/11/2018
+17/12/2018
    - Added search timeout in meta query (margaretha)
+18/12/2018
+   - Updated RewriteHandler (margaretha)
 
 version 0.61.4
 14/11/2018
diff --git a/core/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java b/core/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
index 59101c1..130bc2d 100644
--- a/core/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
+++ b/core/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
@@ -150,10 +150,10 @@
     }
 
 
-    public <T extends ContextHolder> void insertBeans (T beans) {
-        this.beans = beans;
-        this.config = beans.getConfiguration();
-    }
+//    public <T extends ContextHolder> void insertBeans (T beans) {
+//        this.beans = beans;
+//        this.config = beans.getConfiguration();
+//    }
 
 
 
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index f3505ce..65be493 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -83,9 +83,9 @@
         }
         if (index != null){
             String result = new Krill(json).apply(index).toJsonString();
-//            if (DEBUG){
+            if (DEBUG){
                 jlog.debug(result);
-//            }
+            }
             return result;
         }
         Result kr = new Result();
diff --git a/full/Changes b/full/Changes
index c9be960..3532fcd 100644
--- a/full/Changes
+++ b/full/Changes
@@ -1,6 +1,8 @@
 # version 0.61.5
-17/11/2018
+17/12/2018
    - Added a search timeout test (margaretha)
+18/12/2018
+   - Updated tests using BeanConfigTest to use SpringJerseyTest (margaretha)
 
 # version 0.61.4
 14/11/2018
diff --git a/full/src/main/resources/log4j2.properties b/full/src/main/resources/log4j2.properties
index 1acd50c..c4762c2 100644
--- a/full/src/main/resources/log4j2.properties
+++ b/full/src/main/resources/log4j2.properties
@@ -11,6 +11,6 @@
 appender.mainFile.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
 
 rootLogger.level = warn
-rootLogger.appenderRefs = mainFile
+rootLogger.appenderRefs = console,mainFile
 rootLogger.appenderRef.file.ref = MAINLOG
-rootLogger.additivity=false
\ No newline at end of file
+rootLogger.additivity=true
\ No newline at end of file
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/NamedVCLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
similarity index 91%
rename from full/src/test/java/de/ids_mannheim/korap/config/NamedVCLoaderTest.java
rename to full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
index 3fef08f..7e3736a 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/NamedVCLoaderTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.config;
+package de.ids_mannheim.korap.cache;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -10,6 +10,8 @@
 
 import de.ids_mannheim.korap.KrillCollection;
 import de.ids_mannheim.korap.collection.CachedVCData;
+import de.ids_mannheim.korap.config.NamedVCLoader;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.dao.VirtualCorpusDao;
 import de.ids_mannheim.korap.entity.VirtualCorpus;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigBaseTest.java b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigBaseTest.java
deleted file mode 100644
index b69cecf..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigBaseTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.junit.runner.RunWith;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.model.InitializationError;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import net.jcip.annotations.NotThreadSafe;
-
-/**
- * @author hanl
- * @date 09/03/2016
- */
-@Deprecated
-@NotThreadSafe
-@RunWith(BeanConfigBaseTest.SpringExtendedSetupListener.class)
-@ContextConfiguration("classpath:test-config.xml")
-@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
-public abstract class BeanConfigBaseTest {
-
-    private static Logger jlog = LogManager.getLogger(BeanConfigBaseTest.class);
-    @Autowired
-    protected ApplicationContext context;
-    
-    public void init () throws Exception {
-        assertNotNull("Application context must not be null!", this.context);
-        jlog.debug("running one-time before init for class "
-                + this.getClass().getSimpleName() + " ...");
-        BeansFactory.setKustvaktContext(getContext());
-        assertNotNull(BeansFactory.getKustvaktContext());
-        initMethod();
-    }
-
-    protected abstract ContextHolder getContext();
-
-    public abstract void initMethod () throws KustvaktException;
-    
-    public void close () {
-        BeansFactory.closeApplication();
-    }
-
-    public static class SpringExtendedSetupListener extends
-            SpringJUnit4ClassRunner {
-
-        private BeanConfigBaseTest instanceSetupListener;
-
-
-        public SpringExtendedSetupListener (Class<?> clazz)
-                throws InitializationError {
-            super(clazz);
-        }
-
-
-        @Override
-        protected Object createTest () throws Exception {
-            Object test = super.createTest();
-            // Note that JUnit4 will call this createTest() multiple times for each
-            // test method, so we need to ensure to call "beforeClassSetup" only once.
-            if (test instanceof BeanConfigBaseTest && instanceSetupListener == null) {
-                instanceSetupListener = (BeanConfigBaseTest) test;
-                instanceSetupListener.init();
-            }
-            return test;
-        }
-
-
-        @Override
-        public void run (RunNotifier notifier) {
-            super.run(notifier);
-            if (instanceSetupListener != null){
-                instanceSetupListener.close();
-            }
-        }
-    }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/TestBeans.java b/full/src/test/java/de/ids_mannheim/korap/config/TestBeans.java
deleted file mode 100644
index 7994ef5..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/TestBeans.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import java.util.List;
-
-import de.ids_mannheim.korap.authentication.AuthenticationManager;
-import de.ids_mannheim.korap.interfaces.EncryptionIface;
-import de.ids_mannheim.korap.interfaces.EntityHandlerIface;
-import de.ids_mannheim.korap.interfaces.db.AuditingIface;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
-
-/**
- * @author hanl
- * @date 20/02/2016
- */
-public interface TestBeans {
-
-//	public  KustvaktConfiguration getConfig();
-
-	public  EntityHandlerIface getUserDao();
-	
-	public  AuditingIface getAuditingDao();
-
-	public  List<UserDataDbIface> getUserdataDaos();
-
-	public  EncryptionIface getCrypto();
-
-	public  AuthenticationManager getAuthManager();
-
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/ClassLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/ClassLoaderTest.java
index cae64f1..9523bf6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/ClassLoaderTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/ClassLoaderTest.java
@@ -4,11 +4,11 @@
 import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
-import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.DefaultHandler;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.handlers.JDBCAuditing;
 import de.ids_mannheim.korap.interfaces.db.AuditingIface;
 
@@ -16,8 +16,11 @@
  * @author hanl
  * @date 27/07/2015
  */
-public class ClassLoaderTest extends BeanConfigTest {
+public class ClassLoaderTest extends SpringJerseyTest {
 
+    @Autowired
+    AuditingIface audit;
+    
     @Test
     public void testDefaultCreationThrowsNoException () {
         DefaultHandler pl = new DefaultHandler();
@@ -26,25 +29,9 @@
         assertTrue(o instanceof AuditingIface);
     }
 
-
-//    @Test
-//    @Deprecated
-//    public void testDefaultCreation2ThrowsNoException () {
-//        AuthenticationManagerIface iface = helper().getContext()
-//                .getAuthenticationManager();
-//        assertNotNull(iface);
-//        assertTrue(iface instanceof KustvaktAuthenticationManager);
-//    }
-
-
     @Test
     public void testDefaultInterfaceMatchThrowsNoException () {
-        AuditingIface iface = helper().getContext().getAuditingProvider();
-        assertNotNull(iface);
-        assertTrue(iface instanceof JDBCAuditing);
+        assertNotNull(audit);
+        assertTrue(audit instanceof JDBCAuditing);
     }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {}
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java
index 734f78c..bd56477 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java
@@ -6,27 +6,25 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.util.Map;
 import java.util.Properties;
 
-import org.junit.Ignore;
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
-import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.config.ConfigLoader;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.utils.ServiceInfo;
 import de.ids_mannheim.korap.utils.TimeUtils;
 
-/** EM: To do: fix tests
+/** 
  * @author hanl
  * @date 02/09/2015
  */
-@Ignore
-public class ConfigTest extends BeanConfigTest {
+public class ConfigTest extends SpringJerseyTest {
 
+    @Autowired
+    KustvaktConfiguration config;
 
     @Test
     public void testConfigLoader () {
@@ -52,32 +50,11 @@
 
     @Test
     public void testProperties () {
-        assertEquals("token layer does not match", "opennlp", helper()
-                .getContext().getConfiguration().getDefault_token());
+        assertEquals("token layer does not match", "opennlp", config.getDefault_token());
         assertEquals("token expiration does not match",
-                TimeUtils.convertTimeToSeconds("1D"), helper().getContext()
-                        .getConfiguration().getLongTokenTTL());
+                TimeUtils.convertTimeToSeconds("1D"), config.getLongTokenTTL());
     }
 
 
-    @Test(expected = KustvaktException.class)
-    @Ignore
-    public void testBeanOverrideInjection () throws Exception {
-        helper().getContext()
-                .getConfiguration()
-                .setPropertiesAsStream(
-                        ConfigTest.class.getClassLoader().getResourceAsStream(
-                                "kustvakt.conf"));
-    }
-
-    @Test
-    public void testBootConfigDependencyOrder () {
-        // todo:
-
-    }
-
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
+   
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/FileAuditingTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/FileAuditingTest.java
index 188c36a..4fc673b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/FileAuditingTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/FileAuditingTest.java
@@ -1,44 +1,38 @@
 package de.ids_mannheim.korap.misc;
+
 import java.util.Date;
 
 import org.joda.time.LocalDate;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import de.ids_mannheim.korap.auditing.AuditRecord;
-import de.ids_mannheim.korap.config.BeanConfigTest;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.interfaces.db.AuditingIface;
+import de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing;
 
 /**
  * @author hanl
  * @date 27/07/2015
  */
-//todo: test audit commit in thread and that no concurrency issue arrises
-public class FileAuditingTest extends BeanConfigTest {
-
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
-
+// todo: test audit commit in thread and that no concurrency issue
+// arrises
+public class FileAuditingTest {
 
     @Test
     public void testAdd () {
+        AuditingIface auditor = new DefaultAuditing();
         for (int i = 0; i < 20; i++) {
             AuditRecord record = AuditRecord.serviceRecord("MichaelHanl",
                     StatusCodes.ILLEGAL_ARGUMENT, String.valueOf(i),
                     "string value");
-            helper().getContext().getAuditingProvider().audit(record);
+            auditor.audit(record);
         }
     }
 
-
-    @Ignore
-    @Test (expected = UnsupportedOperationException.class)
+    @Test(expected = UnsupportedOperationException.class)
     public void testRetrieval () {
-        helper().getContext().getAuditingProvider()
-                .retrieveRecords(new LocalDate(new Date().getTime()), 10);
+        AuditingIface auditor = new DefaultAuditing();
+        auditor.retrieveRecords(new LocalDate(new Date().getTime()), 10);
     }
 
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java
index 52b331a..ab5039e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java
@@ -3,12 +3,14 @@
 
 import java.io.IOException;
 
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import javax.annotation.PostConstruct;
+
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import de.ids_mannheim.korap.KrillCollection;
-import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.query.serialize.CollectionQueryProcessor;
 import de.ids_mannheim.korap.utils.JsonUtils;
@@ -19,27 +21,26 @@
  * @author hanl
  * @date 14/01/2016
  */
-public class LocalQueryTest extends BeanConfigTest {
+public class LocalQueryTest extends SpringJerseyTest {
 
     private static String index;
-    private static String qstring;
 
+    @Autowired
+    KustvaktConfiguration config;
 
-    @BeforeClass
-    public static void setup () throws Exception {
-        qstring = "creationDate since 1786 & creationDate until 1788";
-        //        qstring = "creationDate since 1765 & creationDate until 1768";
-        //        qstring = "textType = Aphorismus";
-        //        qstring = "title ~ \"Werther\"";
+    @PostConstruct
+    public void setup () throws Exception {
+        index = config.getIndexDir();
     }
 
 
-    @AfterClass
-    public static void drop () {}
-
-
     @Test
     public void testQuery () throws KustvaktException {
+        String qstring = "creationDate since 1786 & creationDate until 1788";
+        //        qstring = "creationDate since 1765 & creationDate until 1768";
+        //        qstring = "textType = Aphorismus";
+        //        qstring = "title ~ \"Werther\"";
+        
         SearchKrill krill = new SearchKrill(index);
         KoralCollectionQueryBuilder coll = new KoralCollectionQueryBuilder();
         coll.with(qstring);
@@ -73,14 +74,4 @@
         assertNotNull(docs);
     }
 
-
-    @Test
-    public void testQueryHash () {}
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-//        helper().runBootInterfaces();
-        index = helper().getContext().getConfiguration().getIndexDir();
-    }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
index 28bab56..e055529 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
@@ -4,10 +4,12 @@
 import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
-import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.config.TestVariables;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
@@ -20,19 +22,15 @@
  * @author hanl
  * @date 03/09/2015
  */
-public class CollectionRewriteTest extends BeanConfigTest {
+public class CollectionRewriteTest extends SpringJerseyTest {
 
-    @Override
-    public void initMethod () throws KustvaktException {
-//        helper().runBootInterfaces();
-    }
-
-
+    @Autowired
+    public KustvaktConfiguration config;
+    
     @Test
     public void testCollectionNodeRemoveCorpusIdNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
@@ -54,8 +52,7 @@
     @Test
     public void testCollectionNodeRemoveAllCorpusIdNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
@@ -75,8 +72,7 @@
     @Test
     public void testCollectionNodeRemoveGroupedCorpusIdNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
@@ -99,8 +95,7 @@
     @Test
     public void testCollectionCleanEmptyDocGroupNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
@@ -128,8 +123,7 @@
     @Test
     public void testCollectionCleanMoveOneDocFromGroupUpNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
@@ -150,8 +144,7 @@
     @Test
     public void testCollectionCleanEmptyGroupAndMoveOneFromGroupUpNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
@@ -172,8 +165,7 @@
     @Test
     public void testCollectionRemoveAndMoveOneFromGroupUpNoErrors ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
@@ -196,8 +188,7 @@
 
     @Test
     public void testPublicCollectionRewriteEmptyAdd () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionRewrite.class);
 
         QuerySerializer s = new QuerySerializer();
@@ -221,8 +212,7 @@
     @Test
     public void testPublicCollectionRewriteNonEmptyAdd ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionRewrite.class);
 
         QuerySerializer s = new QuerySerializer();
@@ -251,8 +241,7 @@
 
     @Test
     public void testRemoveCorpusFromDifferentGroups () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
@@ -277,8 +266,7 @@
     @Test
     public void testRemoveOneCorpusAndMoveDocFromTwoGroups ()
             throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         // todo: use this collection query also to test clean up filter! after reduction of corpusSigle (wiss | freizeit)!
         handler.add(CollectionCleanRewrite.class);
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
index 98828da..f159049 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
@@ -5,22 +5,17 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Ignore;
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.BeanConfigTest;
-import de.ids_mannheim.korap.config.BeansFactory;
-import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.resource.LayerMapper;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserSettings;
+import de.ids_mannheim.korap.user.KorAPUser;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 /**
@@ -28,7 +23,7 @@
  * @date 18/06/2015
  */
 //todo: check position and information of rewrites!
-public class FoundryRewriteTest extends BeanConfigTest {
+public class FoundryRewriteTest extends SpringJerseyTest {
 
     private static String simple_add_query = "[pos=ADJA]";
     private static String simple_rewrite_query = "[base=Haus]";
@@ -36,16 +31,11 @@
     private static String complex_rewrite_query2 = "[orth=laufe/i & base!=Lauf]";
     private static String complex_rewrite_query3 = "[(base=laufen | base=gehen) & tt/pos=VVFIN]";
 
-    private static KustvaktConfiguration config;
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-        config = helper().getContext().getConfiguration();
-//        helper().setupAccount();
-    }
-
-
+    @Autowired
+    public KustvaktConfiguration config;
+    @Autowired
+    public RewriteHandler handler; 
+    
     @Test
     public void testDefaultLayerMapperThrowsNoException () {
         LayerMapper m = new LayerMapper(config);
@@ -58,25 +48,17 @@
     }
 
 
-    @Ignore
-    @Deprecated
     @Test
     public void testDefaultFoundryInjectLemmaThrowsNoError ()
             throws KustvaktException {
 
-        KustvaktConfiguration c = helper().getBean(
-                ContextHolder.KUSTVAKT_CONFIG);
-
-        RewriteHandler processor = new RewriteHandler();
-        processor.insertBeans(helper().getContext());
-        processor.add(FoundryInject.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Haus]", "poliqarp");
-        String result = processor.processQuery(s.toJSON(), null);
+        String result = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode node = JsonUtils.readTree(result);
         assertNotNull(node);
         assertFalse(node.at("/query/wrap/foundry").isMissingNode());
-        assertEquals(c.getDefault_lemma(), node.at("/query/wrap/foundry")
+        assertEquals(config.getDefault_lemma(), node.at("/query/wrap/foundry")
                 .asText());
         assertEquals("lemma", node.at("/query/wrap/layer").asText());
         assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
@@ -88,20 +70,14 @@
     @Test
     public void testDefaultFoundryInjectPOSNoErrors () throws KustvaktException {
 
-        KustvaktConfiguration c = helper().getBean(
-                ContextHolder.KUSTVAKT_CONFIG);
-
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
         s.setQuery("[pos=ADJA]", "poliqarp");
-        assertTrue(handler.add(FoundryInject.class));
-        String result = handler.processQuery(s.toJSON(), null);
+        String result = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode node = JsonUtils.readTree(result);
 
         assertNotNull(node);
         assertFalse(node.at("/query/wrap/foundry").isMissingNode());
-        assertEquals(c.getDefault_pos(), node.at("/query/wrap/foundry")
+        assertEquals(config.getDefault_pos(), node.at("/query/wrap/foundry")
                 .asText());
         assertEquals("pos", node.at("/query/wrap/layer").asText());
         assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
@@ -111,82 +87,77 @@
     }
 
     // EM: Fix me usersetting
-    @Test
-    @Ignore
-    public void testRewriteFoundryInjectPOSThrowsNoError ()
-            throws KustvaktException {
-        User user = helper().getUser();
-
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
-        handler.add(FoundryInject.class);
-        QuerySerializer s = new QuerySerializer();
-        s.setQuery("[pos=ADJA]", "poliqarp");
-        String result = handler.processQuery(s.toJSON(), user);
-        JsonNode node = JsonUtils.readTree(result);
-
-        UserDataDbIface dao = BeansFactory.getTypeFactory()
-                .getTypeInterfaceBean(
-                        helper().getContext().getUserDataProviders(),
-                        UserSettings.class);
-        UserSettings settings = (UserSettings) dao.get(user);
-        assertTrue(settings.isValid());
-        String pos = (String) settings.get(Attributes.DEFAULT_POS_FOUNDRY);
-
-        assertNotNull(node);
-        assertEquals("pos", node.at("/query/wrap/layer").asText());
-        assertEquals(pos, node.at("/query/wrap/foundry").asText());
-        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
-        assertEquals("koral:rewrite", node.at("/query/wrap/rewrites/0/@type")
-                .asText());
-    }
+//    @Test
+//    @Ignore
+//    public void testRewriteFoundryInjectPOSThrowsNoError ()
+//            throws KustvaktException {
+//        User user = helper().getUser();
+//
+//        RewriteHandler handler = new RewriteHandler();
+//        handler.insertBeans(helper().getContext());
+//        handler.add(FoundryInject.class);
+//        QuerySerializer s = new QuerySerializer();
+//        s.setQuery("[pos=ADJA]", "poliqarp");
+//        String result = handler.processQuery(s.toJSON(), user);
+//        JsonNode node = JsonUtils.readTree(result);
+//
+//        UserDataDbIface dao = BeansFactory.getTypeFactory()
+//                .getTypeInterfaceBean(
+//                        helper().getContext().getUserDataProviders(),
+//                        UserSettings.class);
+//        UserSettings settings = (UserSettings) dao.get(user);
+//        assertTrue(settings.isValid());
+//        String pos = (String) settings.get(Attributes.DEFAULT_POS_FOUNDRY);
+//
+//        assertNotNull(node);
+//        assertEquals("pos", node.at("/query/wrap/layer").asText());
+//        assertEquals(pos, node.at("/query/wrap/foundry").asText());
+//        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
+//        assertEquals("koral:rewrite", node.at("/query/wrap/rewrites/0/@type")
+//                .asText());
+//    }
 
     // EM: Fix me usersetting
-    @Test
-    @Ignore
-    public void testRewriteFoundryInjectLemmaThrowsNoError ()
-            throws KustvaktException {
-        KustvaktConfiguration c = helper().getBean(
-                ContextHolder.KUSTVAKT_CONFIG);
-        User user = helper().getUser();
-
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
-        handler.add(FoundryInject.class);
-        QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=Haus]", "poliqarp");
-        String result = handler.processQuery(s.toJSON(), user);
-        JsonNode node = JsonUtils.readTree(result);
-
-        UserDataDbIface dao = BeansFactory.getTypeFactory()
-                .getTypeInterfaceBean(
-                        helper().getContext().getUserDataProviders(),
-                        UserSettings.class);
-        UserSettings settings = (UserSettings) dao.get(user);
-        assertTrue(settings.isValid());
-        String lemma = (String) settings.get(Attributes.DEFAULT_LEMMA_FOUNDRY);
-
-        assertNotNull(node);
-        assertEquals("lemma", node.at("/query/wrap/layer").asText());
-        assertEquals(lemma, node.at("/query/wrap/foundry").asText());
-        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
-        assertEquals("koral:rewrite", node.at("/query/wrap/rewrites/0/@type")
-                .asText());
-    }
+//    @Test
+//    @Ignore
+//    public void testRewriteFoundryInjectLemmaThrowsNoError ()
+//            throws KustvaktException {
+//        KustvaktConfiguration c = helper().getBean(
+//                ContextHolder.KUSTVAKT_CONFIG);
+//        User user = helper().getUser();
+//
+//        RewriteHandler handler = new RewriteHandler();
+//        handler.insertBeans(helper().getContext());
+//        handler.add(FoundryInject.class);
+//        QuerySerializer s = new QuerySerializer();
+//        s.setQuery("[base=Haus]", "poliqarp");
+//        String result = handler.processQuery(s.toJSON(), user);
+//        JsonNode node = JsonUtils.readTree(result);
+//
+//        UserDataDbIface dao = BeansFactory.getTypeFactory()
+//                .getTypeInterfaceBean(
+//                        helper().getContext().getUserDataProviders(),
+//                        UserSettings.class);
+//        UserSettings settings = (UserSettings) dao.get(user);
+//        assertTrue(settings.isValid());
+//        String lemma = (String) settings.get(Attributes.DEFAULT_LEMMA_FOUNDRY);
+//
+//        assertNotNull(node);
+//        assertEquals("lemma", node.at("/query/wrap/layer").asText());
+//        assertEquals(lemma, node.at("/query/wrap/foundry").asText());
+//        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
+//        assertEquals("koral:rewrite", node.at("/query/wrap/rewrites/0/@type")
+//                .asText());
+//    }
 
 
     @Test
     public void testFoundryInjectJoinedQueryNoErrors ()
             throws KustvaktException {
-        KustvaktConfiguration c = helper().getBean(
-                ContextHolder.KUSTVAKT_CONFIG);
 
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
         s.setQuery("[orth=laufe/i & base!=Lauf]", "poliqarp");
-        assertTrue(handler.add(FoundryInject.class));
-        String result = handler.processQuery(s.toJSON(), null);
+        String result = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode node = JsonUtils.readTree(result);
 
         assertNotNull(node);
@@ -202,11 +173,8 @@
     public void testFoundryInjectGroupedQueryNoErrors ()
             throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
         s.setQuery("[(base=laufen | tt/pos=VVFIN)]", "poliqarp");
-        assertTrue(handler.add(FoundryInject.class));
-        String result = handler.processQuery(s.toJSON(), null);
+        String result = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode node = JsonUtils.readTree(result);
 //        System.out.println("NODDE "+ node);
         assertNotNull(node);
@@ -220,29 +188,18 @@
     }
 
     @Test
-    @Ignore
-    public void testFoundyBaseRewrite() throws KustvaktException {
+    public void testFoundryBaseRewrite() throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
         s.setQuery("[orth=laufen]", "poliqarp");
-        assertTrue(handler.add(FoundryInject.class));
-        String result = handler.processQuery(s.toJSON(), null);
+        String result = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode node = JsonUtils.readTree(result);
-//        System.out.println("NODDE "+ node);
-        assertNotNull(node);
-        assertEquals("koral:termGroup", node.at("/query/wrap/@type").asText());
-        assertFalse(node.at("/query/wrap/operands/0/operands/0/foundry")
+        System.out.println("NODE "+ node);
+//        assertNotNull(node);
+        assertEquals("koral:term", node.at("/query/wrap/@type").asText());
+        assertFalse(node.at("/query/wrap/foundry")
                 .isMissingNode());
-        assertFalse(node.at("/query/wrap/operands/0/operands/0/rewrites")
+        assertFalse(node.at("/query/wrap/rewrites")
                 .isMissingNode());
-        assertFalse(node.at("/query/wrap/operands/0/operands/1/foundry")
-                .isMissingNode());
-        assertFalse(node.at("/query/wrap/operands/0/operands/1/rewrites")
-                .isMissingNode());
-
-        assertFalse(node.at("/query/wrap/operands/1/foundry").isMissingNode());
-        assertTrue(node.at("/query/wrap/operands/1/rewrites").isMissingNode());
     }
 
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java
index 65ae668..ed8f4a3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java
@@ -5,31 +5,36 @@
 import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
-import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
+import de.ids_mannheim.korap.user.KorAPUser;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 /**
  * @author hanl
  * @date 21/10/2015
  */
-public class IdRewriteTest extends BeanConfigTest {
+public class IdRewriteTest extends SpringJerseyTest {
 
+    @Autowired
+    private KustvaktConfiguration config;
+    
     @Test
     public void insertTokenId () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         assertTrue(handler.add(IdWriter.class));
 
         String query = "[surface=Wort]";
         QuerySerializer s = new QuerySerializer();
         s.setQuery(query, "poliqarp");
 
-        String value = handler.processQuery(s.toJSON(), null);
+        String value = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode result = JsonUtils.readTree(value);
 
         assertNotNull(result);
@@ -39,13 +44,12 @@
 
     @Test
     public void testIdWriterTest () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         assertTrue(handler.add(IdWriter.class));
 
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Haus]", "poliqarp");
-        String result = handler.processQuery(s.toJSON(), null);
+        String result = handler.processQuery(s.toJSON(), new KorAPUser());
         JsonNode node = JsonUtils.readTree(result);
         assertNotNull(node);
         assertFalse(node.at("/query/wrap").isMissingNode());
@@ -53,8 +57,4 @@
     }
 
 
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
index 32deec8..2fe92d8 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
@@ -3,8 +3,9 @@
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
-import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.config.TestVariables;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.rewrite.CollectionRewrite;
@@ -14,17 +15,13 @@
  * @author hanl
  * @date 12/11/2015
  */
-public class ResultRewriteTest extends BeanConfigTest {
+public class ResultRewriteTest extends SpringJerseyTest {
 
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
-
+    @Autowired
+    public RewriteHandler ha;
+    
     @Test
     public void testPostRewriteNothingToDo () throws KustvaktException {
-        RewriteHandler ha = new RewriteHandler();
-        ha.insertBeans(helper().getContext());
         assertEquals("Handler could not be added to rewrite handler instance!",
                 true, ha.add(CollectionRewrite.class));
 
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
index 67f74bd..30ecd1f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
@@ -1,22 +1,18 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Ignore;
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.BeanConfigTest;
-import de.ids_mannheim.korap.config.BeansFactory;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.user.UserSettings;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 /** EM: to do: Fix tests
@@ -25,12 +21,14 @@
  * @author hanl
  * @date 21/10/2015
  */
-public class RewriteHandlerTest extends BeanConfigTest {
+public class RewriteHandlerTest extends SpringJerseyTest {
 
+    @Autowired
+    private KustvaktConfiguration config;
+    
     @Test
     public void testRewriteTaskAdd () {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         assertTrue(handler.add(FoundryInject.class));
         assertTrue(handler.add(CollectionCleanRewrite.class));
         assertTrue(handler.add(IdWriter.class));
@@ -50,8 +48,7 @@
 
     @Test
     public void testRewriteNoBeanInject () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler(helper().getContext()
-                .getConfiguration());
+        RewriteHandler handler = new RewriteHandler(config);
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
         assertTrue(handler.add(FoundryInject.class));
@@ -61,8 +58,7 @@
     
     @Test
     public void testRewriteBeanInject () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
+        RewriteHandler handler = new RewriteHandler(config);
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=laufen | tt/pos=VVFIN]", "poliqarp");
         assertTrue(handler.add(FoundryInject.class));
@@ -76,26 +72,25 @@
     }
 
     // EM: Fix me usersetting
-    @Test
-    @Ignore
-    public void testRewriteUserSpecific () throws KustvaktException {
-        RewriteHandler handler = new RewriteHandler();
-        handler.insertBeans(helper().getContext());
-        QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=laufen|tt/pos=VFIN]", "poliqarp");
-        assertTrue(handler.add(FoundryInject.class));
-        String res = handler.processQuery(s.toJSON(), helper().getUser());
-        JsonNode node = JsonUtils.readTree(res);
-        assertNotNull(node);
-        assertEquals("tt_test",
-                node.at("/query/wrap/operands/0/foundry").asText());
-        assertNotEquals("tt_test",
-                node.at("/query/wrap/operands/1/foundry").asText());
-    }
+//    @Test
+//    @Ignore
+//    public void testRewriteUserSpecific () throws KustvaktException {
+//        RewriteHandler handler = new RewriteHandler(config);
+//        QuerySerializer s = new QuerySerializer();
+//        s.setQuery("[base=laufen|tt/pos=VFIN]", "poliqarp");
+//        assertTrue(handler.add(FoundryInject.class));
+//        String res = handler.processQuery(s.toJSON(), helper().getUser());
+//        JsonNode node = JsonUtils.readTree(res);
+//        assertNotNull(node);
+//        assertEquals("tt_test",
+//                node.at("/query/wrap/operands/0/foundry").asText());
+//        assertNotEquals("tt_test",
+//                node.at("/query/wrap/operands/1/foundry").asText());
+//    }
 
  // EM: Fix me usersetting
-    @Override
-    public void initMethod () throws KustvaktException {
+//    @Override
+//    public void initMethod () throws KustvaktException {
 //        helper().setupAccount();
 //        UserDataDbIface settingsdao = BeansFactory.getTypeFactory()
 //                .getTypeInterfaceBean(
@@ -105,7 +100,7 @@
 //        UserSettings s = (UserSettings) settingsdao.get(helper().getUser());
 //        s.setField(Attributes.DEFAULT_LEMMA_FOUNDRY, "tt_test");
 //        settingsdao.update(s);
-    }
+//    }
 
 
 
diff --git a/full/src/test/java/de/ids_mannheim/korap/user/UserFactoryTest.java b/full/src/test/java/de/ids_mannheim/korap/user/UserFactoryTest.java
deleted file mode 100644
index 51d03cb..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/user/UserFactoryTest.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package de.ids_mannheim.korap.user;
-
-/**
- * @author hanl
- * @date 04/02/2016
- */
-public class UserFactoryTest {}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java b/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java
index 92400e6..87d62ad 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java
@@ -14,6 +14,10 @@
 import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 
+/**
+ * @author margaretha
+ *
+ */
 public class ApiVersionTest extends SpringJerseyTest {
 
     @Test
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
index ce898c2..b4c5b09 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
@@ -13,6 +13,10 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+/**
+ * @author margaretha
+ *
+ */
 public class JettyServerTest {
 
     @BeforeClass
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/KustvaktCoreRestTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/KustvaktCoreRestTest.java
deleted file mode 100644
index 4d63221..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/KustvaktCoreRestTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package de.ids_mannheim.korap.web.controller;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.sun.jersey.api.client.ClientResponse;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.web.FastJerseyTest;
-
-/**
- * @author hanl
- * @date 26/06/2015
- */
-public class KustvaktCoreRestTest extends FastJerseyTest {
-
-	@Override
-    public void initMethod () throws KustvaktException {
-//        helper().setupAccount();
-//        helper().runBootInterfaces();
-    }
-	
-    //    @Test
-    public void testFieldsInSearch () {
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[base=Wort]")
-                .queryParam("ql", "poliqarp").get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-    }
-
-
-    @Test
-    public void testQuery () {
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[base=Wort]")
-                .queryParam("ql", "poliqarp").get(ClientResponse.class);
-        //        System.out.println("_______________________________________________");
-//                System.out.println(response.getEntity(String.class));
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-    }
-
-
-    @Test
-    public void testQueryRaw () {
-        QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=Wort]", "poliqarp");
-
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").post(ClientResponse.class, s.toJSON());
-        //        System.out.println("_______________________________________________ RAW");
-        //        System.out.println(response.getEntity(String.class));
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-    }
-
-
-    // in case no index is there, this will throw an error
-    @Test
-    @Ignore
-    public void testGetMatchInfoThrowsNoException () {
-        ClientResponse response = resource().path(API_VERSION).get(
-                ClientResponse.class);
-    }
-   
-    //    @Test
-    public void testBuildQueryThrowsNoException () {
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[base=Haus & surface=Hauses]")
-                .queryParam("ql", "poliqarp").queryParam("cutOff", "true")
-                .queryParam("page", "1").method("TRACE", ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-    }
-
-
-    //    @Test
-    public void testQueryByNameThrowsNoException () {
-        ClientResponse response = resource().path(API_VERSION)
-                .path("corpus").path("WPD").path("search")
-                .queryParam("q", "[base=Haus & surface=Hauses]")
-                .queryParam("ql", "poliqarp").queryParam("cutOff", "true")
-                .queryParam("page", "1").get(ClientResponse.class);
-//        System.out.println("RESPONSE " + response.getEntity(String.class));
-    }
-    
-}
