Skip to content

Commit

Permalink
[CST-11738] fixed broken ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
eskander17 committed Oct 20, 2023
1 parent 45b22ef commit ffcc983
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand All @@ -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)));
Expand All @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down

0 comments on commit ffcc983

Please sign in to comment.