Skip to content

Commit

Permalink
[CST-18016] Fixed OpenAlexPublicationLoaderTest
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamF42 committed Feb 25, 2025
1 parent e92a53a commit 94c9287
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public void testSearchMetadataValues_NoMetadata_ReturnsEmptyList() {
@Test
public void testSearchMetadataValues_WithDcIdentifierOther_ReturnsFilterQuery() {

loader.setNames(Arrays.asList("dc.identifier", "dc.contributor.author"));
when(itemService.getMetadata(researcher, "dc.identifier")).thenReturn("ID123");
loader.setNames(Arrays.asList("dc.identifier.openalex", "dc.contributor.author"));
when(itemService.getMetadata(researcher, "dc.identifier.openalex")).thenReturn("ID123");

// When
List<String> result = loader.searchMetadataValues(researcher);
Expand Down Expand Up @@ -91,8 +91,8 @@ public void testSearchMetadataValues_NoDcIdentifierOther_ReturnsAuthorIds() {
@Test
public void testSearchMetadataValues_MixedNullValues_IgnoresNulls() {

loader.setNames(Arrays.asList("dc.identifier", "dc.contributor.author", "dc.title"));
when(itemService.getMetadata(researcher, "dc.identifier")).thenReturn(null);
loader.setNames(Arrays.asList("dc.identifier.openalex", "dc.contributor.author", "dc.title"));
when(itemService.getMetadata(researcher, "dc.identifier.openalex")).thenReturn(null);
when(itemService.getMetadata(researcher, "dc.contributor.author")).thenReturn("Author Name");
when(itemService.getMetadata(researcher, "dc.title")).thenReturn("Title");

Expand Down

0 comments on commit 94c9287

Please sign in to comment.