Skip to content

Commit

Permalink
Remove unused services & unnecessary cache cleanup. This can result i…
Browse files Browse the repository at this point in the history
…n random failures if these services are not yet loaded by another test.

(cherry picked from commit 3b5adf2)
  • Loading branch information
tdonohue authored and github-actions[bot] committed Jul 10, 2024
1 parent 97baa39 commit 7d3f268
Showing 1 changed file with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@
import org.dspace.content.RelationshipType;
import org.dspace.content.WorkspaceItem;
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.ItemService;
import org.dspace.content.service.RelationshipTypeService;
import org.dspace.core.Constants;
import org.dspace.eperson.Group;
import org.dspace.services.ConfigurationService;
import org.dspace.services.factory.DSpaceServicesFactory;
import org.dspace.util.SimpleMapConverter;
import org.hamcrest.Matchers;
import org.junit.Before;
Expand All @@ -68,12 +65,6 @@ public class LinksetRestControllerIT extends AbstractControllerIntegrationTest {
@Autowired
private ConfigurationService configurationService;

@Autowired
private MetadataAuthorityService metadataAuthorityService;

@Autowired
private ChoiceAuthorityService choiceAuthorityService;

@Autowired
private ItemService itemService;

Expand Down Expand Up @@ -736,10 +727,6 @@ public void findTypedLinkForBitstream() throws Exception {
.andExpect(jsonPath("$[?(@.href == '" + uiUrl + "/signposting/linksets/" + item.getID() + "/json" +
"' && @.rel == 'linkset' " +
"&& @.type == 'application/linkset+json')]").exists());

DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
metadataAuthorityService.clearCache();
choiceAuthorityService.clearCache();
}

@Test
Expand Down Expand Up @@ -781,10 +768,6 @@ public void findTypedLinkForBitstreamWithType() throws Exception {
"&& @.type == 'application/linkset+json')]").exists())
.andExpect(jsonPath("$[?(@.href == 'https://schema.org/ScholarlyArticle' " +
"&& @.rel == 'type')]").exists());

DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
metadataAuthorityService.clearCache();
choiceAuthorityService.clearCache();
}

@Test
Expand Down Expand Up @@ -814,10 +797,6 @@ public void findTypedLinkForRestrictedBitstream() throws Exception {

getClient().perform(get("/signposting/links/" + bitstream.getID()))
.andExpect(status().isUnauthorized());

DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
metadataAuthorityService.clearCache();
choiceAuthorityService.clearCache();
}

@Test
Expand Down Expand Up @@ -845,10 +824,6 @@ public void findTypedLinkForBitstreamUnderEmbargo() throws Exception {

getClient().perform(get("/signposting/links/" + bitstream.getID()))
.andExpect(status().isUnauthorized());

DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
metadataAuthorityService.clearCache();
choiceAuthorityService.clearCache();
}

@Test
Expand All @@ -875,10 +850,6 @@ public void findTypedLinkForBitstreamOfWorkspaceItem() throws Exception {

getClient().perform(get("/signposting/links/" + bitstream.getID()))
.andExpect(status().isUnauthorized());

DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
metadataAuthorityService.clearCache();
choiceAuthorityService.clearCache();
}

@Test
Expand All @@ -891,10 +862,6 @@ public void findTypedLinkForUnDiscoverableItem() throws Exception {

getClient().perform(get("/signposting/links/" + item.getID()))
.andExpect(status().isUnauthorized());

DSpaceServicesFactory.getInstance().getConfigurationService().reloadConfig();
metadataAuthorityService.clearCache();
choiceAuthorityService.clearCache();
}

@Test
Expand Down

0 comments on commit 7d3f268

Please sign in to comment.