Skip to content

Commit

Permalink
Set dev null transport external id to accessUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Jul 19, 2024
1 parent a2505d2 commit 3c95cbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public void onSuccess(Submission submission, Deposit deposit, RepositoryCopy rep
(rc) -> true,
(rc) -> true,
(rc) -> {
rc.getExternalIds().add("devnull-fake-extid-" + repositoryCopy.getId());
String accessUrl = "https://devnull-fake-url/handle/" +
repositoryCopy.getId();
rc.getExternalIds().add(accessUrl);
rc.setCopyStatus(CopyStatus.COMPLETE);
rc.setAccessUrl(
URI.create("https://devnull-fake-url/handle/" + repositoryCopy.getId())
);
rc.setAccessUrl(URI.create(accessUrl));
return rc;
}, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,14 @@ private void verifyAccessUrl(Deposit deposit, boolean usingDevNull) throws IOExc
RepositoryCopy j10pRepoCopy = passClient.getObject(deposit.getRepositoryCopy());
String accessUrl = j10pRepoCopy.getAccessUrl().toString();
if (usingDevNull) {
assertEquals("https://devnull-fake-url/handle/" + j10pRepoCopy.getId(), accessUrl);
String expectedUrl = "https://devnull-fake-url/handle/" + j10pRepoCopy.getId();
assertEquals(expectedUrl, accessUrl);
assertEquals(1, j10pRepoCopy.getExternalIds().size());
assertEquals(expectedUrl, j10pRepoCopy.getExternalIds().get(0));
} else {
assertTrue(accessUrl.startsWith("file:"));
assertEquals(1, j10pRepoCopy.getExternalIds().size());
assertTrue(j10pRepoCopy.getExternalIds().get(0).startsWith("file:"));
}
}

Expand Down

0 comments on commit 3c95cbd

Please sign in to comment.