mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
Merge pull request #9692 from DSpace/backport-9691-to-dspace-8_x
[Port dspace-8_x] Fix random test failures in LinksetRestControllerIT and ManageGroupsFeatureIT
This commit is contained in:
@@ -176,7 +176,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a subgroup of the site administrators has this feature
|
// Verify an ePerson in a subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -285,7 +285,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -502,7 +502,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a subgroup of the site administrators has this feature
|
// Verify an ePerson in a subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -636,7 +636,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -897,7 +897,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a subgroup of the site administrators has this feature
|
// Verify an ePerson in a subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -1051,7 +1051,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -1352,7 +1352,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a subgroup of the site administrators has this feature
|
// Verify an ePerson in a subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
@@ -1526,7 +1526,7 @@ public class ManageGroupsFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
// Verify an ePerson in a sub-subgroup of the site administrators has this feature
|
||||||
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri="
|
||||||
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID()))
|
+ "http://localhost/api/core/sites/" + siteService.findSite(context).getID() + "&feature=canManageGroups"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]")
|
||||||
|
@@ -41,15 +41,12 @@ import org.dspace.content.MetadataSchemaEnum;
|
|||||||
import org.dspace.content.RelationshipType;
|
import org.dspace.content.RelationshipType;
|
||||||
import org.dspace.content.WorkspaceItem;
|
import org.dspace.content.WorkspaceItem;
|
||||||
import org.dspace.content.authority.Choices;
|
import org.dspace.content.authority.Choices;
|
||||||
import org.dspace.content.authority.service.ChoiceAuthorityService;
|
|
||||||
import org.dspace.content.authority.service.MetadataAuthorityService;
|
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
import org.dspace.content.service.RelationshipTypeService;
|
import org.dspace.content.service.RelationshipTypeService;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
import org.dspace.eperson.Group;
|
import org.dspace.eperson.Group;
|
||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
|
||||||
import org.dspace.util.SimpleMapConverter;
|
import org.dspace.util.SimpleMapConverter;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -68,12 +65,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ConfigurationService configurationService;
|
private ConfigurationService configurationService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MetadataAuthorityService metadataAuthorityService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ChoiceAuthorityService choiceAuthorityService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ItemService itemService;
|
private ItemService itemService;
|
||||||
|
|
||||||
@@ -736,10 +727,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
.andExpect(jsonPath("$[?(@.href == '" + uiUrl + "/signposting/linksets/" + item.getID() + "/json" +
|
.andExpect(jsonPath("$[?(@.href == '" + uiUrl + "/signposting/linksets/" + item.getID() + "/json" +
|
||||||
"' && @.rel == 'linkset' " +
|
"' && @.rel == 'linkset' " +
|
||||||
"&& @.type == 'application/linkset+json')]").exists());
|
"&& @.type == 'application/linkset+json')]").exists());
|
||||||
|
|
||||||
DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
|
|
||||||
metadataAuthorityService.clearCache();
|
|
||||||
choiceAuthorityService.clearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -781,10 +768,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
"&& @.type == 'application/linkset+json')]").exists())
|
"&& @.type == 'application/linkset+json')]").exists())
|
||||||
.andExpect(jsonPath("$[?(@.href == 'https://schema.org/ScholarlyArticle' " +
|
.andExpect(jsonPath("$[?(@.href == 'https://schema.org/ScholarlyArticle' " +
|
||||||
"&& @.rel == 'type')]").exists());
|
"&& @.rel == 'type')]").exists());
|
||||||
|
|
||||||
DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
|
|
||||||
metadataAuthorityService.clearCache();
|
|
||||||
choiceAuthorityService.clearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -814,10 +797,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
getClient().perform(get("/signposting/links/" + bitstream.getID()))
|
getClient().perform(get("/signposting/links/" + bitstream.getID()))
|
||||||
.andExpect(status().isUnauthorized());
|
.andExpect(status().isUnauthorized());
|
||||||
|
|
||||||
DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
|
|
||||||
metadataAuthorityService.clearCache();
|
|
||||||
choiceAuthorityService.clearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -845,10 +824,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
getClient().perform(get("/signposting/links/" + bitstream.getID()))
|
getClient().perform(get("/signposting/links/" + bitstream.getID()))
|
||||||
.andExpect(status().isUnauthorized());
|
.andExpect(status().isUnauthorized());
|
||||||
|
|
||||||
DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
|
|
||||||
metadataAuthorityService.clearCache();
|
|
||||||
choiceAuthorityService.clearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -875,10 +850,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
getClient().perform(get("/signposting/links/" + bitstream.getID()))
|
getClient().perform(get("/signposting/links/" + bitstream.getID()))
|
||||||
.andExpect(status().isUnauthorized());
|
.andExpect(status().isUnauthorized());
|
||||||
|
|
||||||
DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
|
|
||||||
metadataAuthorityService.clearCache();
|
|
||||||
choiceAuthorityService.clearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -891,10 +862,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
|
|
||||||
getClient().perform(get("/signposting/links/" + item.getID()))
|
getClient().perform(get("/signposting/links/" + item.getID()))
|
||||||
.andExpect(status().isUnauthorized());
|
.andExpect(status().isUnauthorized());
|
||||||
|
|
||||||
DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
|
|
||||||
metadataAuthorityService.clearCache();
|
|
||||||
choiceAuthorityService.clearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user