mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
Replace GroupService by GroupBuilder in a couple tests
This commit is contained in:
@@ -1640,15 +1640,11 @@ public class GroupRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void deleteGroupTest() throws Exception {
|
||||
|
||||
GroupService groupService = EPersonServiceFactory.getInstance().getGroupService();
|
||||
|
||||
Group parentGroup = null;
|
||||
|
||||
try {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
parentGroup = groupService.create(context);
|
||||
Group parentGroup = GroupBuilder.createGroup(context)
|
||||
.withName("test group")
|
||||
.build();
|
||||
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
@@ -1665,25 +1661,15 @@ public class GroupRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
getClient(authToken).perform(
|
||||
get("/api/eperson/groups/" + parentGroup.getID())
|
||||
).andExpect(status().isNotFound());
|
||||
|
||||
} finally {
|
||||
if (parentGroup != null) {
|
||||
GroupBuilder.deleteGroup(parentGroup.getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void deleteGroupUnauthorizedTest() throws Exception {
|
||||
|
||||
GroupService groupService = EPersonServiceFactory.getInstance().getGroupService();
|
||||
|
||||
Group parentGroup = null;
|
||||
|
||||
try {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
parentGroup = groupService.create(context);
|
||||
Group parentGroup = GroupBuilder.createGroup(context)
|
||||
.withName("test group")
|
||||
.build();
|
||||
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
@@ -1700,12 +1686,6 @@ public class GroupRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
getClient(authToken).perform(
|
||||
get("/api/eperson/groups/" + parentGroup.getID())
|
||||
).andExpect(status().isOk());
|
||||
|
||||
} finally {
|
||||
if (parentGroup != null) {
|
||||
GroupBuilder.deleteGroup(parentGroup.getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user