Added default foundry for structure layer.

Change-Id: I808745f3e4ae83157204a13061bd3f6b2d6e799c
diff --git a/full/Changes b/full/Changes
index e8ba17d..adb6bf6 100644
--- a/full/Changes
+++ b/full/Changes
@@ -5,6 +5,8 @@
 05/02/2019
    - Added delete-group-by-name controller (margaretha)
    - Added unique index to group name (margaretha)
+06/02/2019
+   - Updated a user setting test using array for multiple values (margaretha)
 
 # version 0.61.5
 17/12/2018
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java
index 813fb72..bc7afdd 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java
@@ -58,13 +58,13 @@
     public void deleteDefaultSetting (String username)
             throws KustvaktException {
         ParameterChecker.checkObjectValue(username, "defaultSetting");
-        DefaultSetting defaultSetting = retrieveDefautlSetting(username);
+        DefaultSetting defaultSetting = retrieveDefaultSetting(username);
         if (defaultSetting != null){
             entityManager.remove(defaultSetting);
         }
     }
 
-    public DefaultSetting retrieveDefautlSetting (String username)
+    public DefaultSetting retrieveDefaultSetting (String username)
             throws KustvaktException {
         ParameterChecker.checkStringValue(username, "username");
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java b/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java
index fc924db..96ebeb8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java
@@ -61,7 +61,7 @@
         processor.readQuietly(map, false);
 
         DefaultSetting defaultSetting =
-                settingDao.retrieveDefautlSetting(username);
+                settingDao.retrieveDefaultSetting(username);
         if (defaultSetting == null) {
             createDefaultSetting(username, processor);
             return HttpStatus.SC_CREATED;
@@ -99,7 +99,7 @@
     public String retrieveDefaultSettings (String username)
             throws KustvaktException {
         DefaultSetting defaultSetting =
-                settingDao.retrieveDefautlSetting(username);
+                settingDao.retrieveDefaultSetting(username);
         if (defaultSetting == null) {
             return null;
         }
@@ -110,7 +110,7 @@
             throws KustvaktException {
         username = verifiyUsername(username, contextUsername);
         DefaultSetting defaultSetting =
-                settingDao.retrieveDefautlSetting(username);
+                settingDao.retrieveDefaultSetting(username);
 
         String jsonSettings = defaultSetting.getSettings();
         UserSettingProcessor processor = new UserSettingProcessor(jsonSettings);
diff --git a/full/src/main/resources/kustvakt.conf b/full/src/main/resources/kustvakt.conf
index ec540f9..24dcb47 100644
--- a/full/src/main/resources/kustvakt.conf
+++ b/full/src/main/resources/kustvakt.conf
@@ -36,6 +36,7 @@
 default.foundry.dependency = malt
 default.foundry.constituent = corenlp
 default.foundry.morphology = marmot
+default.foundry.surface = base
 
 ## delete configuration (default hard)
 # delete.auto.group = hard
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 bd56477..ffe1c51 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
@@ -50,7 +50,7 @@
 
     @Test
     public void testProperties () {
-        assertEquals("token layer does not match", "opennlp", config.getDefault_token());
+        assertEquals("token layer does not match", "opennlp", config.getDefault_orthography());
         assertEquals("token expiration does not match",
                 TimeUtils.convertTimeToSeconds("1D"), config.getLongTokenTTL());
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java
index ee86fc2..ce2f6ad 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java
@@ -114,7 +114,7 @@
     public void testDefaultLayerMapperThrowsNoException () {
         assertEquals(config.getDefault_lemma(), m.findFoundry("lemma"));
         assertEquals(config.getDefault_pos(), m.findFoundry("pos"));
-        assertEquals(config.getDefault_token(), m.findFoundry("surface"));
+        assertEquals(config.getDefault_orthography(), m.findFoundry("surface"));
         assertEquals(config.getDefault_dep(), m.findFoundry("d"));
         assertEquals(config.getDefault_const(), m.findFoundry("c"));
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java
index 29c5890..c04aee1 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java
@@ -46,8 +46,8 @@
     @Test
     public void testCreateSettingWithJson () throws KustvaktException {
         String json =
-                "{\"pos-foundry\":\"opennlp\",\"metadata\":\"author title "
-                        + "textSigle availability\",\"resultPerPage\":25}";
+                "{\"pos-foundry\":\"opennlp\",\"metadata\":[\"author\", \"title\","
+                        + "\"textSigle\", \"availability\"],\"resultPerPage\":25}";
 
         ClientResponse response = resource().path(API_VERSION)
                 .path("~" + username).path("setting")
@@ -59,7 +59,8 @@
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
 
         int numOfResult = 25;
-        String metadata = "author title textSigle availability";
+        String metadata = "[\"author\",\"title\",\"textSigle\","
+                + "\"availability\"]";
 
         testRetrieveSettings(username, "opennlp", numOfResult, metadata);
 
@@ -254,6 +255,7 @@
                 .get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
+        System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         if (posFoundry == null) {
             assertTrue(node.at("/pos-foundry").isMissingNode());
@@ -262,7 +264,7 @@
             assertEquals(posFoundry, node.at("/pos-foundry").asText());
         }
         assertEquals(numOfResult, node.at("/resultPerPage").asInt());
-        assertEquals(metadata, node.at("/metadata").asText());
+        assertEquals(metadata, node.at("/metadata").toString());
     }
 
 }
diff --git a/full/src/test/resources/kustvakt-test.conf b/full/src/test/resources/kustvakt-test.conf
index b3d2985..7587bc9 100644
--- a/full/src/test/resources/kustvakt-test.conf
+++ b/full/src/test/resources/kustvakt-test.conf
@@ -36,6 +36,7 @@
 default.foundry.dependency = malt
 default.foundry.constituent = corenlp
 default.foundry.morphology = marmot
+default.foundry.surface = base 
 
 ## delete configuration (default hard)
 # delete.auto.group = hard