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
Import Process
Fedora Ingest Service
Commits
2e03248d
Commit
2e03248d
authored
Jul 20, 2020
by
Jonas Waeber
Browse files
Fix bug in Ingester
was serializing as RDF/XML... and update test for docker image.
parent
5f72ede9
Pipeline
#11734
passed with stages
in 5 minutes and 19 seconds
Changes
4
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
src/main/kotlin/Ingester.kt
View file @
2e03248d
...
...
@@ -48,9 +48,10 @@ class Ingester(private val producer: Producer, private val sftpClient: SftpClien
val
recordOutput
=
StringWriter
()
val
recordPair
=
rdfHandler
.
getRecord
()
recordPair
.
second
.
write
(
recordOutput
)
recordPair
.
second
.
write
(
recordOutput
,
"NTRIPLES"
)
try
{
fedoraClient
.
createOrUpdateRdfResource
(
URI
(
recordPair
.
first
),
recordOutput
.
toString
(),
RdfContentTypes
.
NTRIPLES
)
val
data
=
recordOutput
.
toString
()
fedoraClient
.
createOrUpdateRdfResource
(
URI
(
recordPair
.
first
),
data
,
RdfContentTypes
.
NTRIPLES
)
log
.
info
(
"Ingested record ${recordPair.first}."
)
producer
.
sendReport
(
Report
(
recordPair
.
first
,
ReportStatus
.
success
,
"Ingested record in fedora."
))
...
...
@@ -62,7 +63,7 @@ class Ingester(private val producer: Producer, private val sftpClient: SftpClien
rdfHandler
.
getInstantiations
().
forEach
{
instantiationPair
->
val
instantiationOutput
=
StringWriter
()
instantiationPair
.
second
.
write
(
instantiationOutput
)
instantiationPair
.
second
.
write
(
instantiationOutput
,
"NTRIPLES"
)
try
{
val
data
=
instantiationOutput
.
toString
()
fedoraClient
.
createOrUpdateRdfResource
(
URI
(
instantiationPair
.
first
),
data
,
RdfContentTypes
.
NTRIPLES
)
...
...
src/test/kotlin/ServiceTest.kt
View file @
2e03248d
...
...
@@ -88,7 +88,8 @@ class ServiceTest {
reportConsumer
.
subscribe
(
listOf
(
"test-ingest-out"
))
}
// TODO: Change to correct test
// TODO: Test works with local docker
// docker run --rm -p 8081:8080 --name=fcrepo5 fcrepo/fcrepo:5.1.0
@ParameterizedTest
@MethodSource
(
"kafkaTests"
)
fun
testRun
(
params
:
TestParams
)
{
...
...
@@ -123,7 +124,8 @@ class ServiceTest {
assertThat(totalConsumerRecords)
.size().isEqualTo(3)
*/
*/
}
private
fun
kafkaTests
()
=
Stream
.
of
(
...
...
src/test/resources/integration/1/input.nt
View file @
2e03248d
This diff is collapsed.
Click to expand it.
src/test/resources/test1.yml
View file @
2e03248d
...
...
@@ -7,8 +7,8 @@ app:
appDirectory
:
/memobase/test_record_set_1
fedora
:
username
:
fedoraAdmin
password
:
${FEDORA_PASSWORD:?system}
internalBaseUrl
:
http://localhost:808
0
/fcrepo/rest/
password
:
fedoraAdmin
internalBaseUrl
:
http://localhost:808
1
/fcrepo/rest/
externalBaseUrl
:
https://memobase.ch/
kafka
:
consumer
:
...
...
Write
Preview
Supports
Markdown
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