Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
EASY-2273: Improve submit state description (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanheest authored and lindareijnhoudt committed Sep 5, 2019
1 parent bf6be1a commit 44bb1a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/nl.knaw.dans.easy.deposit/Submitter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Submitter(stagingBaseDir: File,
// EASY-1464 3.3.8.a create empty staged bag to take a copy of the deposit
stageBag <- DansV0Bag.empty(stagedDir / bagDirName).map(_.withCreated())
// EASY-1464 3.3.6 change state and copy with the rest of the deposit properties to staged dir
_ <- stateManager.changeState(StateInfo(State.submitted, "Deposit is ready for processing."))
_ <- stateManager.changeState(StateInfo(State.submitted, "The deposit is being processed"))
submittedId <- stateManager.getSubmittedBagId // created by changeState
submitDir = submitToBaseDir / submittedId.toString
_ = if (submitDir.exists) throw AlreadySubmittedException(draftDeposit.id)
Expand Down
16 changes: 8 additions & 8 deletions src/test/scala/nl.knaw.dans.easy.deposit/StateManagerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class StateManagerSpec extends TestSupportFixture {
// the problem will be logged
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The dataset is ready for processing
|state.description = The deposit is being processed
""".stripMargin)
StateManager(draftDeposit, submitBase, easyHome).getStateInfo shouldBe Success(StateInfo(
State.submitted,
Expand All @@ -69,7 +69,7 @@ class StateManagerSpec extends TestSupportFixture {
// the problem will be logged
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The dataset is ready for processing
|state.description = The deposit is being processed
|bag-store.bag-id = $submittedUuid
""".stripMargin)
StateManager(draftDeposit, submitBase, easyHome).getStateInfo shouldBe Success(StateInfo(
Expand All @@ -81,7 +81,7 @@ class StateManagerSpec extends TestSupportFixture {
it should "change SUBMITTED to IN_PROGRESS" in {
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The deposit is ready for processing
|state.description = The deposit is being processed
|bag-store.bag-id = $submittedUuid
""".stripMargin)
submittedPropsFile.writeText(
Expand All @@ -97,7 +97,7 @@ class StateManagerSpec extends TestSupportFixture {
it should "return the fedora landing page" in {
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The deposit is ready for processing
|state.description = The deposit is being processed
|bag-store.bag-id = $submittedUuid
|identifier.doi = 10.5072/dans-zyf-v9sc
""".stripMargin)
Expand All @@ -116,7 +116,7 @@ class StateManagerSpec extends TestSupportFixture {
it should "mail the draft uuid" in {
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The deposit is ready for processing
|state.description = The deposit is being processed
""".stripMargin)
submittedPropsFile.writeText(
s"""state.label = REJECTED
Expand All @@ -135,7 +135,7 @@ class StateManagerSpec extends TestSupportFixture {
it should "mail the submitted uuid" in {
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The deposit is ready for processing
|state.description = The deposit is being processed
|bag-store.bag-id = $submittedUuid
""".stripMargin)
submittedPropsFile.writeText(
Expand All @@ -162,7 +162,7 @@ class StateManagerSpec extends TestSupportFixture {
it should "return the curators message" in {
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The deposit is ready for processing
|state.description = The deposit is being processed
|bag-store.bag-id = $submittedUuid
""".stripMargin)
submittedPropsFile.writeText(
Expand All @@ -176,7 +176,7 @@ class StateManagerSpec extends TestSupportFixture {
it should "return a generic landing page when no fedora-id is available" in {
draftPropsFile.writeText(
s"""state.label = SUBMITTED
|state.description = The deposit is ready for processin
|state.description = The deposit is being processed
|bag-store.bag-id = $submittedUuid
|identifier.doi = 10.5072/dans-zyf-v9sc
""".stripMargin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class IntegrationSpec extends TestSupportFixture with ServletFixture with Scalat
get(
uri = s"/deposit/$uuid/state", headers = Seq(fooBarBasicAuthHeader),
) {
body shouldBe """{"state":"SUBMITTED","stateDescription":"Deposit is ready for processing."}"""
body shouldBe """{"state":"SUBMITTED","stateDescription":"The deposit is being processed"}"""
status shouldBe OK_200
}
}
Expand Down

0 comments on commit 44bb1a5

Please sign in to comment.