Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Converter
Commits
d7634e53
Verified
Commit
d7634e53
authored
Oct 22, 2021
by
Sebastian Schüpbach
Browse files
fix tests
parent
de0985a8
Pipeline
#35335
passed with stages
in 5 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/ch/memobase/models/BinaryResourceMetadata.scala
View file @
d7634e53
...
...
@@ -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
),
...
...
src/test/scala/ch/memobase/BinaryResourceMetadataTest.scala
View file @
d7634e53
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment