Fixed DummyAuthenticationManager and the search test with fields.
Change-Id: I0aa3c8444133a0bf04e648c23b78c99229b505f8
diff --git a/lite/Changes b/lite/Changes
index 8519d7a..8a068e2 100644
--- a/lite/Changes
+++ b/lite/Changes
@@ -1,3 +1,8 @@
+version 0.61.3
+19/12/2018
+ - Fixed getUser in DummyAuthenticationManager (margaretha)
+ - Fixed search test with fields parameter (margaretha)
+
version 0.61.2
14/11/2018
- Integrated lite and full services and controllers in core (margaretha)
diff --git a/lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java b/lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
index 22f1d12..06cbf5f 100644
--- a/lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
+++ b/lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
@@ -11,6 +11,7 @@
import de.ids_mannheim.korap.constant.TokenType;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.security.context.TokenContext;
+import de.ids_mannheim.korap.user.KorAPUser;
import de.ids_mannheim.korap.user.User;
import de.ids_mannheim.korap.user.Userdata;
import de.ids_mannheim.korap.utils.TimeUtils;
@@ -38,8 +39,9 @@
@Override
public User getUser (String username) throws KustvaktException {
- // TODO Auto-generated method stub
- return null;
+ KorAPUser user = new KorAPUser();
+ user.setUsername(username);
+ return user;
}
@Override
diff --git a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java
index 68088fc..d2d9733 100644
--- a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java
+++ b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java
@@ -137,7 +137,8 @@
public void testParameterField () throws KustvaktException {
ClientResponse response = resource().path(API_VERSION).path("search")
.queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
- .queryParam("fields", "author, docSigle")
+ .queryParam("fields", "author")
+ .queryParam("fields", "docSigle")
.queryParam("context", "sentence").queryParam("count", "13")
.get(ClientResponse.class);
assertEquals(ClientResponse.Status.OK.getStatusCode(),
@@ -147,7 +148,7 @@
assertNotNull(node);
assertEquals("orth", node.at("/query/wrap/layer").asText());
assertNotEquals(0, node.at("/matches").size());
- assertEquals("[\"author, docSigle\"]",
+ assertEquals("[\"author\",\"docSigle\"]",
node.at("/meta/fields").toString());
}