Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failed deposit retry submission status bug #68

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void testRetryFailedDeposits_Success_WithMultipleFiles() throws IOException {
Submission submission = new Submission();
deposit1.setSubmission(submission);
when(passClient.getObject(same(deposit1), any())).thenReturn(deposit1);
when(passClient.getObject(same(submission), any())).thenReturn(submission);
when(packagerRegistry.get(any())).thenReturn(packager);
DepositSubmission depositSubmission = new DepositSubmission();
DepositFile depositFile1 = new DepositFile();
Expand Down
Loading