Skip to content

Commit

Permalink
[CST-11738] setting default behavior for orcid to 'will be referenced'
Browse files Browse the repository at this point in the history
  • Loading branch information
steph-ieffam committed Oct 25, 2023
1 parent ffcc983 commit 5b4703a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package org.dspace.app.rest;

import static org.dspace.authority.service.AuthorityValueService.GENERATE;
import static org.dspace.authority.service.AuthorityValueService.REFERENCE;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.empty;
import static org.mockito.ArgumentMatchers.anyInt;
Expand Down Expand Up @@ -140,7 +141,7 @@ public void testWithWillBeGeneratedAuthorityPrefix() throws Exception {
affiliationEntry(author_2, "Author 2", ""),
affiliationEntry(author_3, "Author 3", "OrgUnit_2::" + id(orgUnit_2)),
affiliationEntry(author_4, "Author 4", "OrgUnit_1::" + id(orgUnit_1)),
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", GENERATE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(20)))
Expand Down Expand Up @@ -187,9 +188,9 @@ public void testWithWillBeReferencedAuthorityPrefix() throws Exception {
affiliationEntry(author_2, "Author 2", ""),
affiliationEntry(author_3, "Author 3", "OrgUnit_2::" + id(orgUnit_2)),
affiliationEntry(author_4, "Author 4", "OrgUnit_1::" + id(orgUnit_1)),
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", GENERATE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(20)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(1)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(7)));
Expand Down Expand Up @@ -236,9 +237,9 @@ public void testWithPagination() throws Exception {
affiliationEntry(author_2, "Author 2", ""),
affiliationEntry(author_3, "Author 3", "OrgUnit_2::" + id(orgUnit_2)),
affiliationEntry(author_4, "Author 4", "OrgUnit_1::" + id(orgUnit_1)),
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", GENERATE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(10)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(1)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(7)));
Expand Down Expand Up @@ -284,7 +285,7 @@ public void testWithPagination() throws Exception {
affiliationEntry(author_2, "Author 2", ""),
affiliationEntry(author_3, "Author 3", "OrgUnit_2::" + id(orgUnit_2)),
affiliationEntry(author_4, "Author 4", "OrgUnit_1::" + id(orgUnit_1)),
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"))))
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"))))
.andExpect(jsonPath("$.page.size", Matchers.is(5)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(2)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(7)));
Expand All @@ -297,8 +298,8 @@ public void testWithPagination() throws Exception {
.param("size", "5"))
.andExpect(status().isOk())
.andExpect(jsonPath("$._embedded.entries", containsInAnyOrder(
orcidEntry("Author From Orcid 2", GENERATE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
orcidEntry("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(5)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(2)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(7)));
Expand All @@ -311,7 +312,7 @@ public void testWithPagination() throws Exception {
.param("size", "6"))
.andExpect(status().isOk())
.andExpect(jsonPath("$._embedded.entries", containsInAnyOrder(
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(6)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(2)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(7)));
Expand Down Expand Up @@ -532,9 +533,9 @@ public void testWithComposedName() throws Exception {
.param("filter", "John Bruce Wayne"))
.andExpect(status().isOk())
.andExpect(jsonPath("$._embedded.entries", containsInAnyOrder(
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", GENERATE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(20)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(1)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(3)));
Expand Down Expand Up @@ -567,9 +568,9 @@ public void testWithLastNameAndFirstNameSeparatedByComma() throws Exception {
.param("filter", "Wayne, Bruce"))
.andExpect(status().isOk())
.andExpect(jsonPath("$._embedded.entries", containsInAnyOrder(
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", GENERATE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", GENERATE, "0000-5555-6666-7777"))))
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"),
orcidEntry("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444"),
orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777"))))
.andExpect(jsonPath("$.page.size", Matchers.is(20)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(1)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(3)));
Expand Down Expand Up @@ -598,9 +599,9 @@ public void testWithAffiliationExtra() throws Exception {
.param("filter", "author"))
.andExpect(status().isOk())
.andExpect(jsonPath("$._embedded.entries", containsInAnyOrder(
orcidEntry("Author From Orcid 1", GENERATE, "0000-1111-2222-3333"),
orcidEntryWithAffiliation("Author From Orcid 2", GENERATE, "0000-2222-3333-4444", "Org1, Org2"),
orcidEntryWithAffiliation("Author From Orcid 3", GENERATE, "0000-5555-6666-7777", "Organization"))))
orcidEntry("Author From Orcid 1", REFERENCE, "0000-1111-2222-3333"),
orcidEntryWithAffiliation("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444", "Org1, Org2"),
orcidEntryWithAffiliation("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777", "Organization"))))
.andExpect(jsonPath("$.page.size", Matchers.is(20)))
.andExpect(jsonPath("$.page.totalPages", Matchers.is(1)))
.andExpect(jsonPath("$.page.totalElements", Matchers.is(3)));
Expand Down
2 changes: 1 addition & 1 deletion dspace/config/modules/orcid.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ orcid.webhook.registration-mode = only_linked
# your webhooks
orcid.webhook.registration-token = 01dfd257-c13f-43df-a0e2-9bb6c3cc7069

orcid.authority.prefix = will be generated::ORCID::
orcid.authority.prefix = will be referenced::ORCID::

orcid.linkable-metadata-fields.ignore =

Expand Down

0 comments on commit 5b4703a

Please sign in to comment.