diff --git a/src/test/java/UserdataTest.java b/src/test/java/UserdataTest.java
index ea47a99..b635ddc 100644
--- a/src/test/java/UserdataTest.java
+++ b/src/test/java/UserdataTest.java
@@ -1,4 +1,5 @@
 import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.user.*;
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -64,26 +65,43 @@
         data.addField(Attributes.COUNTRY, "Germany");
 
         String[] req = data.requiredFields();
-        String[] r = data.validationReturn();
+        String[] r = data.missing();
         assert r.length > 0;
         assert r.length == req.length;
         assert !data.isValid();
     }
 
     @Test
-    public void testUserdatafactory() {
+    public void testSettingsValidation() {
+        Userdata data = new UserSettings2(1);
+        data.addField(Attributes.FILE_FORMAT_FOR_EXPORT, "export");
+
+        String[] req = data.requiredFields();
+        String[] r = data.missing();
+        assert r.length == 0;
+        assert r.length == req.length;
+        assert data.isValid();
+    }
+
+    @Test
+    public void testUserdatafactory() throws KustvaktException {
         UserDataDbIface dao = UserdataFactory
                 .getDaoInstance(Userdetails2.class);
         assert UserDetailsDao.class.equals(dao.getClass());
     }
 
-    @Test(expected = RuntimeException.class)
-    public void testUserdatafactoryError() {
+    @Test(expected = KustvaktException.class)
+    public void testUserdatafactoryError() throws KustvaktException {
         UserdataFactory.getDaoInstance(new Userdata(1) {
             @Override
             public String[] requiredFields() {
                 return new String[0];
             }
+
+            @Override
+            public String[] defaultFields() {
+                return new String[0];
+            }
         }.getClass());
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index 739b16d..c96906d 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -33,6 +33,10 @@
             Map m = new HashMap<>();
             m.put(Attributes.USERNAME, credentials[0]);
             m.put(Attributes.PASSWORD, credentials[1]);
+            m.put(Attributes.FIRSTNAME, "test");
+            m.put(Attributes.LASTNAME, "user");
+            m.put(Attributes.EMAIL, "test@ids-mannheim.de");
+            m.put(Attributes.ADDRESS, "Mannheim");
 
             Assert.assertNotNull("userdatabase handler must not be null", dao);
 
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java
index 9673bd5..62beae8 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java
@@ -55,7 +55,7 @@
         assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
 
         JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        System.out.println("COLLECTIONS " + node);
+
         assert node.size() > 0;
     }
 
@@ -69,20 +69,22 @@
 
         JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
         assert node != null;
-        System.out.println("JSON NODE RESULT " + node);
+
+        System.out.println("-------------------------------");
+        System.out.println("NODE COLLECTIONS" + node);
         String id = node.path(0).path("id").asText();
 
         response = resource().path(getAPIVersion()).path("collection").path(id)
                 .path("stats").header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
-        System.out.println("----------------------------- testStats 2");
-        System.out.println(response.getEntity(String.class));
+
         assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
         node = JsonUtils.readTree(response.getEntity(String.class));
         assert node != null;
         int docs = node.path("documents").asInt();
-        System.out.println("THE FINAL NODE : " + node);
+        System.out.println("-------------------------------");
+        System.out.println("NODE " + node);
         assert docs > 0 && docs < 15;
     }
 
