Verified Commit d7634e53 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

fix tests

parent de0985a8
Pipeline #35335 passed with stages
in 5 minutes and 15 seconds
......@@ -79,7 +79,7 @@ object BinaryResourceMetadata extends RecordUtils {
v.obj match {
case v if isLocalRecord(v) && isProcessableMimeType(v) =>
val instantiation = MemobaseResource(v("type").str)
val locator = v("locator").str.split("/").last.split(".")(0).replaceAll(" ", "_")
val locator = v("locator").str.split("/").last.split("\\.")(0).replaceAll(" ", "_")
BinaryResourceMetadata(
v("@id").str.substring(s"$baseUrl/digital/".length - 1),
buildDistributorUrl(locator, distributorHost, instantiation),
......
......@@ -38,7 +38,7 @@ class BinaryResourceMetadataTest extends AnyFunSuite {
}
test("the value of the id field of a KafkaMessage should match the id of the parsed object") {
val km = BinaryResourceMetadata.build(loadMessageWithBinaryResource("image/png", "sftp:/BAZ-MEI_77466-1/binary"), externalBaseUrl, "mb-wf2")
val km = BinaryResourceMetadata.build(loadMessageWithBinaryResource("image/png", "sftp:/swissbib_index/baz-001/media/BAZ-MEI_77466-1.jpg"), externalBaseUrl, "mb-wf2")
assert(km.head.isSuccess)
}
......@@ -53,7 +53,7 @@ class BinaryResourceMetadataTest extends AnyFunSuite {
test("a unmanageable mime type should throw a UnmanageableMediaFileType exception") {
assertThrows[UnmanageableMediaFileType] {
BinaryResourceMetadata.build(loadMessageWithBinaryResource("application/pdf",
"sftp:/BAZ-MEI_77466-1/binary"), externalBaseUrl, "mb-wf2")
"sftp:/swissbib_index/mb_sftp/baz-001/thumbnails/BAZ-MEI_77466-1.jpg"), externalBaseUrl, "mb-wf2")
.head
.get
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment