From ffcc9831bc6230214cb2d4c1063b599e6b79735a Mon Sep 17 00:00:00 2001 From: eskander Date: Fri, 20 Oct 2023 18:45:41 +0300 Subject: [PATCH] [CST-11738] fixed broken ITs --- .../org/dspace/app/rest/OrcidAuthorityIT.java | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidAuthorityIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidAuthorityIT.java index 33bb24f8b029..6a8a579dc139 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidAuthorityIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidAuthorityIT.java @@ -8,7 +8,6 @@ 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; @@ -188,9 +187,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", 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")))) + 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")))) .andExpect(jsonPath("$.page.size", Matchers.is(20))) .andExpect(jsonPath("$.page.totalPages", Matchers.is(1))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(7))); @@ -237,9 +236,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", 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")))) + 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")))) .andExpect(jsonPath("$.page.size", Matchers.is(10))) .andExpect(jsonPath("$.page.totalPages", Matchers.is(1))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(7))); @@ -285,7 +284,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", REFERENCE, "0000-1111-2222-3333")))) + orcidEntry("Author From Orcid 1", GENERATE, "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))); @@ -298,8 +297,8 @@ public void testWithPagination() throws Exception { .param("size", "5")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.entries", containsInAnyOrder( - orcidEntry("Author From Orcid 2", REFERENCE, "0000-2222-3333-4444"), - orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777")))) + 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(5))) .andExpect(jsonPath("$.page.totalPages", Matchers.is(2))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(7))); @@ -312,7 +311,7 @@ public void testWithPagination() throws Exception { .param("size", "6")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.entries", containsInAnyOrder( - orcidEntry("Author From Orcid 3", REFERENCE, "0000-5555-6666-7777")))) + orcidEntry("Author From Orcid 3", GENERATE, "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))); @@ -533,9 +532,9 @@ public void testWithComposedName() throws Exception { .param("filter", "John Bruce Wayne")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.entries", containsInAnyOrder( - 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")))) + 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")))) .andExpect(jsonPath("$.page.size", Matchers.is(20))) .andExpect(jsonPath("$.page.totalPages", Matchers.is(1))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(3))); @@ -568,9 +567,9 @@ public void testWithLastNameAndFirstNameSeparatedByComma() throws Exception { .param("filter", "Wayne, Bruce")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.entries", containsInAnyOrder( - 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")))) + 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")))) .andExpect(jsonPath("$.page.size", Matchers.is(20))) .andExpect(jsonPath("$.page.totalPages", Matchers.is(1))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(3))); @@ -599,9 +598,9 @@ public void testWithAffiliationExtra() throws Exception { .param("filter", "author")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.entries", containsInAnyOrder( - 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")))) + 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")))) .andExpect(jsonPath("$.page.size", Matchers.is(20))) .andExpect(jsonPath("$.page.totalPages", Matchers.is(1))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(3)));