diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java b/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java
index e06d9f7..6c2834b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java
@@ -89,9 +89,4 @@
         authenticationManager.getUserData(user, UserSettingProcessor.class);
     }
 
-
-    @Override
-    public void initMethod () throws KustvaktException {
-        helper().setupAccount();
-    }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
index 2268d87..0de7e58 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
@@ -34,13 +34,10 @@
         assertNotNull("Application context must not be null!", this.context);
         jlog.debug("running one-time before init for class "
                 + this.getClass().getSimpleName() + " ...");
-        BeansFactory.setKustvaktContext(getContext());
+//        BeansFactory.setKustvaktContext(getContext());
         assertNotNull(BeansFactory.getKustvaktContext());
-        initMethod();
     }
 
-    public abstract void initMethod () throws KustvaktException;
-
     public void close () {
         BeansFactory.closeApplication();
     }
@@ -80,16 +77,16 @@
         }
     }
 
-    protected ContextHolder getContext () {
-        return helper().getContext();
-    }
-
-    protected TestHelper helper () {
-        try {
-            return TestHelper.newInstance(this.context);
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
+//    protected ContextHolder getContext () {
+//        return helper().getContext();
+//    }
+//
+//    protected TestHelper helper () {
+//        try {
+//            return TestHelper.newInstance(this.context);
+//        }
+//        catch (Exception e) {
+//            return null;
+//        }
+//    }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
deleted file mode 100644
index efe2fd8..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ /dev/null
@@ -1,325 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.File;
-import java.io.IOException;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.dbcp2.BasicDataSource;
-import org.flywaydb.core.Flyway;
-import org.joda.time.DateTime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.jdbc.core.RowCallbackHandler;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-import org.springframework.jdbc.datasource.SingleConnectionDataSource;
-
-import de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.JDBCClient;
-import de.ids_mannheim.korap.interfaces.EntityHandlerIface;
-import de.ids_mannheim.korap.interfaces.KustvaktBaseDaoInterface;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.utils.TimeUtils;
-
-/**
- * creates a test user that can be used to access protected functions
- * 
- * @author hanl
- * @date 16/10/2015
- */
-public class TestHelper {
-
-    private static Logger jlog = LoggerFactory.getLogger(TestHelper.class);
-    private static final Map<String, Object> data = new HashMap<>();
-    static  {
-        data.put(Attributes.ID, 3); // 2);
-        data.put(Attributes.USERNAME, "testUser1"); // bodmer funktioniert noch nicht
-        data.put(Attributes.PASSWORD, "testPass2015");
-        data.put(Attributes.FIRSTNAME, "test");
-        data.put(Attributes.LASTNAME, "user");
-        data.put(Attributes.EMAIL, "test@ids-mannheim.de");
-        data.put(Attributes.ADDRESS, "Mannheim");
-        data.put(Attributes.DEFAULT_FOUNDRY_LEMMA, "test_l");
-        data.put(Attributes.DEFAULT_FOUNDRY_POS, "test_p");
-        data.put(Attributes.DEFAULT_FOUNDRY_CONSTITUENT, "test_const");
-    }
-
-    private ContextHolder beansHolder;
-
-    public static TestHelper newInstance (ApplicationContext ctx)
-            throws Exception {
-        TestHelper b = new TestHelper();
-        b.beansHolder = new ContextHolder(ctx) {};
-        return b;
-    }
-
-
-    public <T> T getBean (Class<T> type) {
-        return this.beansHolder.getBean(type);
-    }
-
-
-    public ContextHolder getContext () {
-        return this.beansHolder;
-    }
-
-
-    public <T> T getBean (String name) {
-        return (T) this.beansHolder.getBean(name);
-    }
-
-
-    public TestHelper setupAccount () throws KustvaktException {
-        KustvaktBaseDaoInterface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
-
-        KustvaktAuthenticationManager manager = getBean(ContextHolder.KUSTVAKT_AUTHENTICATION_MANAGER);
-//        manager.createUserAccount(KustvaktConfiguration.KUSTVAKT_USER, false);
-        try {
-            User user = getUser();
-            jlog.debug("found user, skipping setup ...");
-            if (!user.getUsername().equals(data.get(Attributes.USERNAME))){
-            	return this;
-            }
-        }
-        catch (RuntimeException e) {
-            // do nothing and continue
-        }
-
-        Map m = getUserCredentials();
-        assertNotNull("userdatabase handler must not be null", dao);
-
-//        try {
-//            manager.createUserAccount(m, false);
-//        }
-//        catch (KustvaktException e) {
-//            throw new RuntimeException(e);
-//            /*// do nothing
-//            jlog.error("Error: {}", e.string());
-//            assertNotNull("Test user could not be set up", null);*/
-//        }
-        assertNotEquals(0, dao.size());
-        return this;
-    }
-
-    // EM
-    @Deprecated
-//    public TestHelper setupSimpleAccount (String username, String password) {
-//        KustvaktBaseDaoInterface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
-//        EntityHandlerIface edao = (EntityHandlerIface) dao;
-//        try {
-//            edao.getAccount(username);
-//        }
-//        catch (EmptyResultException e) {
-//            // do nothing
-//        }
-//        catch (KustvaktException ex) {
-//            assertNull("Test user could not be set up", true);
-//        }
-//
-//        Map m = new HashMap<>();
-//        m.put(Attributes.USERNAME, username);
-//
-//        try {
-//            String hash = ((EncryptionIface) getBean(ContextHolder.KUSTVAKT_ENCRYPTION))
-//                    .secureHash(password);
-//            m.put(Attributes.PASSWORD, hash);
-//        }
-//        catch (NoSuchAlgorithmException | UnsupportedEncodingException
-//                | KustvaktException e) {
-//            // do nohting
-//            assertNotNull("Exception thrown", null);
-//        }
-//        assertNotNull("userdatabase handler must not be null", dao);
-//
-//        try {
-//
-//            int i = edao.createAccount(User.UserFactory.toKorAPUser(m));
-//            assert BeansFactory.getKustvaktContext().getUserDBHandler()
-//                    .getAccount((String) data.get(Attributes.USERNAME)) != null;
-//            assertEquals(1, i);
-//        }
-//        catch (KustvaktException e) {
-//            // do nothing
-//            assertNull("Test user could not be set up", true);
-//        }
-//        return this;
-//    }
-
-
-    public User getUser () {
-        try {
-            return ((EntityHandlerIface) getBean(ContextHolder.KUSTVAKT_USERDB))
-                    .getAccount((String) data.get(Attributes.USERNAME));
-        }
-        catch (KustvaktException e) {
-            // do nothing
-        }
-        throw new RuntimeException("User could not be retrieved!");
-    }
-
-
-    public TestHelper dropUser (String ... usernames) throws KustvaktException {
-        if (usernames == null || usernames.length == 0) {
-            KustvaktBaseDaoInterface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
-            dao.truncate();
-        }
-        for (String name : Arrays.asList(usernames)) {
-            if (remove(name))
-                break;
-        }
-        return this;
-    }
-
-
-    private boolean remove (String username) throws KustvaktException {
-        EntityHandlerIface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
-        User us = dao.getAccount(username);
-        dao.deleteAccount(us.getId());
-        return true;
-    }
-
-
-    public TestHelper truncateAll () {
-        String sql = "SELECT Concat('TRUNCATE TABLE ', TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES";
-        final Set<String> queries = new HashSet<>();
-        PersistenceClient cl = getBean(ContextHolder.KUSTVAKT_POLICIES);
-        NamedParameterJdbcTemplate source = (NamedParameterJdbcTemplate) cl
-                .getSource();
-
-        source.query(sql, new RowCallbackHandler() {
-            @Override
-            public void processRow (ResultSet rs) throws SQLException {
-                queries.add(rs.getString(1));
-
-            }
-        });
-//        System.out.println(queries);
-        for (String query : queries)
-            source.update(query, new HashMap<String, Object>());
-        return this;
-    }
-
-
-    public static Map<String, Object> getUserCredentials () {
-        return new HashMap<>(data);
-    }
-
-    public void close () {
-        BeansFactory.closeApplication();
-    }
-
-
-    private TestHelper () {
-
-    }
-
-    // EM: use Spring XML config
-    @Deprecated
-    private static PersistenceClient mysql_db () throws IOException {
-        BasicDataSource dataSource = new BasicDataSource();
-        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
-        dataSource.setUrl("jdbc:mysql://localhost:3306/kustvakt_test");
-        dataSource.setUsername("mhanl");
-        dataSource.setPassword("password");
-        JDBCClient client = new JDBCClient(dataSource);
-        client.setDatabase("mariadb");
-
-        Flyway fl = new Flyway();
-        fl.setDataSource(dataSource);
-        fl.setLocations("db.mysql");
-        fl.migrate();
-
-        return client;
-    }
-
-    // EM: use Spring XML config
-    @Deprecated
-    protected static PersistenceClient sqlite_db (boolean memory)
-            throws InterruptedException {
-        SingleConnectionDataSource dataSource = new SingleConnectionDataSource();
-        dataSource.setDriverClassName("org.sqlite.JDBC");
-        DateTime t = TimeUtils.getNow();
-        //String name = testclass != null ? testclass.getSimpleName() + "_" : "";
-
-        if (memory)
-            dataSource.setUrl("jdbc:sqlite::memory:");
-        else {
-            File tmp = new File("tmp");
-            if (!tmp.exists())
-                tmp.mkdirs();
-            dataSource.setUrl("jdbc:sqlite:tmp/sqlite_" + t.getMillis()
-                    + ".sqlite");
-        }
-        dataSource.setSuppressClose(true);
-
-        Flyway fl = new Flyway();
-        fl.setDataSource(dataSource);
-        fl.setLocations("db.sqlite");
-        fl.migrate();
-
-        JDBCClient client = new JDBCClient(dataSource);
-        client.setDatabase("sqlite");
-        return client;
-    }
-
-    // EM: use Spring XML config
-    @Deprecated
-    public static PersistenceClient sqlite_db_norm (boolean memory) {
-        BasicDataSource dataSource = new BasicDataSource();
-        dataSource.setDriverClassName("org.sqlite.JDBC");
-        dataSource.setMaxTotal(1);
-        dataSource.setInitialSize(1);
-        dataSource.setMaxIdle(1);
-        dataSource.addConnectionProperty("lazy-init", "true");
-        DateTime t = TimeUtils.getNow();
-        if (memory)
-            dataSource.setUrl("jdbc:sqlite::memory:");
-        else {
-            File tmp = new File("tmp");
-            if (!tmp.exists())
-                tmp.mkdirs();
-            dataSource.setUrl("jdbc:sqlite:tmp/sqlite_" + t.toString());
-        }
-
-        Flyway fl = new Flyway();
-        fl.setDataSource(dataSource);
-        fl.setLocations("db.sqlite");
-        fl.migrate();
-
-        JDBCClient client = new JDBCClient(dataSource);
-        client.setDatabase("sqlite");
-        return client;
-    }
-
-    // EM: use Spring XML config
-    @Deprecated
-    public static PersistenceClient h2_emb () throws SQLException {
-        BasicDataSource dataSource = new BasicDataSource();
-        dataSource.setUrl("jdbc:h2:mem:");
-        dataSource.getConnection().nativeSQL("SET MODE MySQL;");
-        dataSource.getConnection().commit();
-        dataSource.setUsername("sa");
-        dataSource.setPassword("");
-        dataSource.setDriverClassName("org.h2.Driver");
-
-        Flyway fl = new Flyway();
-        fl.setDataSource(dataSource);
-        fl.setLocations("db.mysql");
-        fl.migrate();
-        JDBCClient client = new JDBCClient(dataSource);
-        client.setDatabase("h2");
-        return client;
-    }
-
-    }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java
deleted file mode 100644
index bae08c3..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package de.ids_mannheim.korap.misc;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.sun.jersey.api.client.ClientResponse;
-
-import de.ids_mannheim.korap.config.BeansFactory;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.web.FastJerseyTest;
-
-/**
- * EM: DemoUser is not saved in the new DB
- * 
- * @author hanl
- * @date 04/02/2016
- */
-@Deprecated
-@Ignore
-public class DemoUserTest extends FastJerseyTest {
-
-    @Override
-    public void initMethod () throws KustvaktException {
-        helper().setupAccount();
-        BeansFactory.setKustvaktContext(helper().getContext());
-    }
-
-
-    @Test
-    public void testDemoCollectionGet () {
-        //        ClientResponse response = resource().path(getVersion())
-        //                .path("collection").path("i");
-    }
-
-
-    @Test
-    public void testDemoUserInfoGet () {
-
-    }
-
-
-    @Test
-    public void testDemoUserDetailsGet () {
-
-    }
-
-
-    @Test
-    public void testDemoUserSettingsGet () {
-
-    }
-
-
-    @Test
-    public void testSearch () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[base=Wort]")
-                .queryParam("ql", "poliqarp").get(ClientResponse.class);
-
-//        System.out.println("_____________________________");
-//        System.out.println(response);
-//        System.out.println("entity " + response.getEntity(String.class));
-    }
-
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/FilterTest.java b/full/src/test/java/de/ids_mannheim/korap/web/FilterTest.java
deleted file mode 100644
index 9c80de5..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/web/FilterTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package de.ids_mannheim.korap.web;
-
-import static org.junit.Assert.assertEquals;
-
-import org.eclipse.jetty.server.Response;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.UniformInterfaceException;
-
-import de.ids_mannheim.korap.authentication.http.HttpAuthorizationHandler;
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.TestHelper;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-
-/** EM: fix tests. new DB does not save users.
- * @author hanl
- * @date 08/02/2016
- */
-@Ignore
-public class FilterTest extends FastJerseyTest {
-
-    @Test
-    public void testTestUserAuth () throws UniformInterfaceException, ClientHandlerException, 
-        KustvaktException {
-        
-        ClientResponse resp = resource()
-                .path("user/info")
-                .header(Attributes.AUTHORIZATION,
-                        HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(
-                                (String) TestHelper.getUserCredentials().get(Attributes.USERNAME),
-                                (String) TestHelper.getUserCredentials().get(Attributes.PASSWORD)))
-                .get(ClientResponse.class);
-        assert resp.getStatus() == Response.SC_OK;
-    }
-
-
-    @Test
-    @Ignore
-    public void testDemoAuth () {
-        ClientResponse resp = resource()
-                .path("user/info").get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(), resp.getStatus());
-    }
-
-
-    @Test
-    public void testUnauthorizedAuth () throws UniformInterfaceException, 
-        ClientHandlerException, KustvaktException {
-        
-        ClientResponse resp = resource()
-                .path("user/info")
-                .header(Attributes.AUTHORIZATION,
-                        HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(
-                                "kustvakt", "kustvakt2015"))
-                .get(ClientResponse.class);
-        String entity = resp.getEntity(String.class);
-//        System.out.println(entity);
-        assertEquals(ClientResponse.Status.UNAUTHORIZED.getStatusCode(), resp.getStatus());
-    }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-//        helper().setupAccount();
-    }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AuthenticationControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AuthenticationControllerTest.java
index 9997c10..d5f4aeb 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/AuthenticationControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AuthenticationControllerTest.java
@@ -6,7 +6,6 @@
 import static org.junit.Assert.assertNotNull;
 
 import org.joda.time.DateTime;
-import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -15,10 +14,8 @@
 
 import de.ids_mannheim.korap.authentication.http.HttpAuthorizationHandler;
 import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.TimeUtils;
 import de.ids_mannheim.korap.web.FastJerseyTest;
@@ -33,25 +30,6 @@
 
     private static String[] credentials;
     
-    @BeforeClass
-    public static void configure () throws Exception {
-        credentials = new String[2];
-        credentials[0] = (String) TestHelper.getUserCredentials().get(Attributes.USERNAME);
-        credentials[1] = (String) TestHelper.getUserCredentials().get(Attributes.PASSWORD);
-    }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-        helper().setupAccount();
-    }
-
-
-    @Test
-    public void testBasicHttp () {
-        User user = helper().getUser();
-    }
-
     @Test
     public void testSessionToken() throws KustvaktException {
         String auth = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue( 
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java
index cd35e86..198a1cb 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java
@@ -29,12 +29,6 @@
 @Ignore
 public class QuerySerializationControllerTest extends FastJerseyTest {
 
-    @Override
-    public void initMethod () throws KustvaktException {
-        // helper().runBootInterfaces();
-    }
-
-
     @Test
     public void testQuerySerializationFilteredPublic ()
             throws KustvaktException {
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java
index 67b0916..3e38c9a 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java
@@ -25,11 +25,6 @@
 @Ignore
 public class ResourceInfoControllerTest extends FastJerseyTest {
 
-    @Override
-    public void initMethod () throws KustvaktException {
-        // helper().runBootInterfaces();
-    }
-
     @Test
     public void testGetPublicVirtualCollectionInfo () throws KustvaktException {
         ClientResponse response = resource().path(getAPIVersion())
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/ShibbolethUserControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/ShibbolethUserControllerTest.java
index cc25d21..9d9e2c3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/ShibbolethUserControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/ShibbolethUserControllerTest.java
@@ -6,7 +6,6 @@
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
-import java.net.URI;
 import java.text.ParseException;
 import java.util.HashMap;
 import java.util.Map;
@@ -15,7 +14,6 @@
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.commons.collections.map.LinkedMap;
-import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,7 +29,6 @@
 import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.FullConfiguration;
 import de.ids_mannheim.korap.config.JWTSigner;
-import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.utils.JsonUtils;
@@ -52,18 +49,6 @@
     FullConfiguration config;
 	private static String[] credentials;
 
-	@Override
-	public void initMethod() throws KustvaktException {
-		helper().setupAccount();
-	}
-
-	@BeforeClass
-	public static void setup() throws Exception {
-		credentials = new String[2];
-		credentials[0] = (String) TestHelper.getUserCredentials().get(Attributes.USERNAME);
-		credentials[1] = (String) TestHelper.getUserCredentials().get(Attributes.PASSWORD);
-	}
-
 	@Test
 	public void loginHTTP() throws KustvaktException {
 		String enc = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(credentials[0], credentials[1]);
@@ -203,7 +188,6 @@
 		assertNotNull(node);
 		assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
 		assertEquals("UserDetails", node.at("/errors/0/2").asText());
-		helper().dropUser("userservicetest");
 	}
 
 	@Test
