Remove hidden group from test database.
Change-Id: Ia2123291c75103f32efc931299f4c1e82df72ea1
diff --git a/Changes b/Changes
index a621898..3893aa6 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,7 @@
- Add institution & landingPage to the resource web-service (#777)
- Make URL mandatory for plugin registration (#573)
+- Remove hidden group from test database
# version 0.75
diff --git a/src/main/resources/db/test/V3.1__insert_virtual_corpus.sql b/src/main/resources/db/test/V3.1__insert_virtual_corpus.sql
index 8be3e86..26a7243 100644
--- a/src/main/resources/db/test/V3.1__insert_virtual_corpus.sql
+++ b/src/main/resources/db/test/V3.1__insert_virtual_corpus.sql
@@ -7,8 +7,8 @@
--INSERT INTO user_group(name,status,created_by,created_date)
-- VALUES ("dory-group","ACTIVE","dory",CURRENT_TIMESTAMP);
-INSERT INTO user_group(name,status,created_by,created_date)
- VALUES ("auto-group","HIDDEN","system",CURRENT_TIMESTAMP);
+--INSERT INTO user_group(name,status,created_by,created_date)
+-- VALUES ("auto-group","HIDDEN","system",CURRENT_TIMESTAMP);
--INSERT INTO user_group(name,status,created_by)
-- VALUES ("all users","HIDDEN","system");
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerAdminTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerAdminTest.java
index 6ea1d0a..6a5e77e 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerAdminTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerAdminTest.java
@@ -2,6 +2,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.JsonNode;
@@ -148,9 +149,9 @@
assertEquals(entity, "[]");
}
- @Test
- public void testListByStatusAll ()
+ private void testListByStatusAll ()
throws KustvaktException {
+ createDoryGroup();
Response response = target().path(API_VERSION).path("admin")
.path("group").path("list").request()
.header(Attributes.AUTHORIZATION,
@@ -163,37 +164,27 @@
assertEquals(Status.OK.getStatusCode(), response.getStatus());
String entity = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(entity);
- boolean containsHiddenStatus = false;
- for (int i = 0; i < node.size(); i++) {
- if (node.get(i).at("/status").asText().equals("HIDDEN")) {
- containsHiddenStatus = true;
- }
- }
- assertEquals(true, containsHiddenStatus);
+ assertEquals(2, node.size());
+ assertEquals("HIDDEN", node.get(0).at("/status").asText());
+
+ deleteGroupByName(doryGroupName, "dory");
}
@Test
- public void testListHiddenGroups ()
- throws KustvaktException {
- JsonNode node = listHiddenGroup();
- assertEquals(1, node.size());
- }
-
- @Test
- public void testRetrieveHiddenGroupEmptyMember() throws KustvaktException {
- createDoryGroup();
+ public void testHiddenGroupEmptyMember() throws KustvaktException {
createPublishedVC("dory", "dory-published");
JsonNode node = listHiddenGroup();
- assertEquals(2, node.size());
+ assertEquals(1, node.size());
- String name = node.at("/1/name").asText();
+ String name = node.at("/0/name").asText();
JsonNode groupNode = retrieveGroup(name);
assertEquals(name, groupNode.at("/name").asText());
+ testListByStatusAll();
+
deleteVC("dory-published", "dory", "dory");
- deleteGroupByName(doryGroupName, "dory");
}
@Test