Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Set DepositStatus to "accepted" if RepositoryCopy link added (#19)
Browse files Browse the repository at this point in the history
* Set Deposit status to accepted when there is a RepositoryCopy
* Bump version to 1.2.4 for release
  • Loading branch information
karenhanson authored Jun 25, 2018
1 parent 35723b9 commit 49c8d7e
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion entrez-pmid-lookup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>

<artifactId>entrez-pmid-lookup</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion nihms-data-harvest-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>
<artifactId>nihms-data-harvest-cli</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion nihms-data-harvest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>

<artifactId>nihms-data-harvest</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion nihms-data-transform-load-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>
<artifactId>nihms-data-transform-load-cli</artifactId>
<name>NIHMS Data Transform/Load Command Line Interface</name>
Expand Down
2 changes: 1 addition & 1 deletion nihms-data-transform-load/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>
<artifactId>nihms-data-transform-load</artifactId>
<name>NIHMS Data Transform/Load</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

import org.dataconservancy.pass.client.nihms.NihmsPassClientService;
import org.dataconservancy.pass.model.Deposit;
import org.dataconservancy.pass.model.Deposit.DepositStatus;
import org.dataconservancy.pass.model.Publication;
import org.dataconservancy.pass.model.RepositoryCopy;
import org.dataconservancy.pass.model.Submission;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
*
* Creates / updates the Submission, RepositoryCopy, Publication, and Deposit in the database as needed
* @author Karen Hanson
*/
public class SubmissionLoader {
Expand Down Expand Up @@ -98,6 +99,7 @@ public void load(SubmissionDTO dto) {
Deposit deposit = clientService.findNihmsDepositForSubmission(submission.getId());
if (deposit!=null && deposit.getRepositoryCopy()==null) {
deposit.setRepositoryCopy(repositoryCopyUri);
deposit.setDepositStatus(DepositStatus.ACCEPTED);
clientService.updateDeposit(deposit);
} else if (deposit!=null && !deposit.getRepositoryCopy().equals(repositoryCopyUri)) {
//this shouldn't happen in principle, but if it does it should be checked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public void testLoadExistingPubExistingSubmissionNewRepoCopy() throws Exception

Deposit deposit = new Deposit();
deposit.setId(new URI(sDepositUri));
deposit.setDepositStatus(DepositStatus.ACCEPTED);
deposit.setDepositStatus(DepositStatus.SUBMITTED);
deposit.setRepository(repositoryCopy.getRepository());

SubmissionDTO dto = new SubmissionDTO();
Expand Down Expand Up @@ -295,6 +295,7 @@ public void testLoadExistingPubExistingSubmissionNewRepoCopy() throws Exception
ArgumentCaptor<Deposit> depositCaptor = ArgumentCaptor.forClass(Deposit.class);
verify(clientServiceMock).updateDeposit(depositCaptor.capture());
deposit.setRepositoryCopy(repositoryCopyUri);
deposit.setDepositStatus(DepositStatus.ACCEPTED);
assertEquals(deposit, depositCaptor.getValue());

}
Expand Down
2 changes: 1 addition & 1 deletion nihms-etl-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>
<artifactId>nihms-etl-integration</artifactId>
<name>NIHMS ELT Integration Tests</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public void testCompliantPublicationExistingSubmissionAndDeposit() throws Except

//check repository copy link added, but status did not change... status managed by deposit service
Deposit deposit = client.readResource(preexistingDepositUri, Deposit.class);
assertEquals(preexistingDeposit.getDepositStatus(), deposit.getDepositStatus());
assertEquals(DepositStatus.ACCEPTED, deposit.getDepositStatus());
assertEquals(repocopyUri, deposit.getRepositoryCopy());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void testInProcessExistingSubmissionDeposit() throws Exception {

//check repository copy link added, but status did not change... status managed by deposit service
Deposit deposit = client.readResource(preexistingDepositUri, Deposit.class);
assertEquals(preexistingDeposit.getDepositStatus(), deposit.getDepositStatus());
assertEquals(DepositStatus.ACCEPTED, deposit.getDepositStatus());
assertEquals(repocopyUri, deposit.getRepositoryCopy());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void testStalledPublicationExistingSubmissionAndDeposit() throws Exceptio

//check repository copy link added, but status did not change... status managed by deposit service
Deposit deposit = client.readResource(preexistingDepositUri, Deposit.class);
assertEquals(preexistingDeposit.getDepositStatus(), deposit.getDepositStatus());
assertEquals(DepositStatus.ACCEPTED, deposit.getDepositStatus());
assertEquals(repocopyUri, deposit.getRepositoryCopy());

}
Expand Down
2 changes: 1 addition & 1 deletion nihms-etl-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>

<artifactId>nihms-etl-model</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion nihms-etl-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>
<artifactId>nihms-etl-util</artifactId>
<name>NIHMS ETL Utilities</name>
Expand Down
2 changes: 1 addition & 1 deletion nihms-pass-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</parent>

<artifactId>nihms-pass-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.dataconservancy.pass</groupId>
<artifactId>pass-nihms-submission-etl</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
<packaging>pom</packaging>

<name>PASS NIHMS Submission Extract-Transform-Load</name>
Expand Down

0 comments on commit 49c8d7e

Please sign in to comment.