Skip to content

Commit

Permalink
Include publication when getting submission
Browse files Browse the repository at this point in the history
On deposit failed retry so repoCopy has
publication if retry succeeds and repoCopy is
created.
  • Loading branch information
rpoet-jh committed Oct 24, 2023
1 parent a2abbdc commit 8b7d5e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public FailedDepositRetry(PassClient passClient, DepositTaskHelper depositTaskHe
public void retryFailedDeposit(Deposit failedDeposit) {
try {
Deposit deposit = passClient.getObject(failedDeposit, "submission", "repository");
final Submission submission = deposit.getSubmission();
final Submission submission = passClient.getObject(deposit.getSubmission(),
"publication", "submitter");
final Repository repository = deposit.getRepository();

final Packager packager = packagerRegistry.get(repository.getRepositoryKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.eclipse.pass.deposit.service;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
Expand Down Expand Up @@ -66,9 +67,13 @@ public void testFailedDepositRetry() throws Exception {

Deposit actualDeposit = actualDeposits.getResult().iterator().next();
Deposit updatedDeposit = passClient.getObject(actualDeposit, "repositoryCopy");
RepositoryCopy popRepoCopy = passClient.getObject(updatedDeposit.getRepositoryCopy(), "repository");
RepositoryCopy popRepoCopy = passClient.getObject(updatedDeposit.getRepositoryCopy(),
"repository", "publication");
updatedDeposit.setRepositoryCopy(popRepoCopy);
verify(passClient).updateObject(eq(updatedDeposit));
assertEquals(submission.getPublication().getId(), popRepoCopy.getPublication().getId());
assertEquals(1, submission.getRepositories().size());
assertEquals(submission.getRepositories().get(0).getId(), popRepoCopy.getRepository().getId());
}

private Submission initFailedSubmissionDeposit() throws Exception {
Expand Down

0 comments on commit 8b7d5e7

Please sign in to comment.