-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EASY-2390: Zet dans-doi-action op 'update' als DOI en BASE-REVISION z…
…ijn gegeven (#157)
- Loading branch information
1 parent
60b9d65
commit 072cfe6
Showing
7 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,8 @@ class AddPropertiesToDepositSpec extends TestSupportFixture with BeforeAndAfterE | |
private val depositId = "ds1" | ||
private val datamanagerId = "dm" | ||
private val datamanagerEmail = "[email protected]" | ||
private val action = new AddPropertiesToDeposit | ||
private val dansDoiPrefix = "10.17026/" | ||
private val action = new AddPropertiesToDeposit(dansDoiPrefix) | ||
|
||
override def beforeEach(): Unit = { | ||
val path = stagingDir / s"sd-$depositId" | ||
|
@@ -83,6 +84,52 @@ class AddPropertiesToDepositSpec extends TestSupportFixture with BeforeAndAfterE | |
resultProps.getString("deposit.origin") shouldBe "SMD" | ||
} | ||
|
||
it should "generate the properties file and write the properties in it with dans-doi.action 'update'" in { | ||
val uuid = UUID.randomUUID() | ||
action.addDepositProperties(testInstructions2.copy(audioVideo = AudioVideo()).toDeposit().copy(bagId = uuid), datamanagerId, datamanagerEmail) shouldBe right[Unit] | ||
|
||
val props = stagingPropertiesFile(testInstructions2.depositId) | ||
props.toJava should exist | ||
|
||
val resultProps = new PropertiesConfiguration { | ||
setDelimiterParsingDisabled(true) | ||
load(props.toJava) | ||
} | ||
|
||
resultProps.getKeys.asScala.toList should { | ||
contain only( | ||
"bag-store.bag-id", | ||
"creation.timestamp", | ||
"state.label", | ||
"state.description", | ||
"depositor.userId", | ||
"curation.datamanager.email", | ||
"curation.datamanager.userId", | ||
"curation.required", | ||
"curation.performed", | ||
"identifier.dans-doi.registered", | ||
"identifier.dans-doi.action", | ||
"bag-store.bag-name", | ||
"deposit.origin", | ||
) and contain noneOf( | ||
"springfield.domain", | ||
"springfield.user", | ||
"springfield.collection", | ||
"springfield.playmode", | ||
) | ||
} | ||
|
||
resultProps.getString("bag-store.bag-id") shouldBe uuid.toString | ||
resultProps.getString("depositor.userId") shouldBe "ruimtereiziger2" | ||
resultProps.getString("curation.datamanager.email") shouldBe datamanagerEmail | ||
resultProps.getString("curation.datamanager.userId") shouldBe datamanagerId | ||
resultProps.getString("curation.required") shouldBe "yes" | ||
resultProps.getString("curation.performed") shouldBe "yes" | ||
resultProps.getString("identifier.dans-doi.registered") shouldBe "no" | ||
resultProps.getString("identifier.dans-doi.action") shouldBe "update" | ||
resultProps.getString("deposit.origin") shouldBe "SMD" | ||
} | ||
|
||
it should "generate the properties file with springfield fields and write the properties in it" in { | ||
val uuid = UUID.randomUUID() | ||
|
||
|