Commit 2e03248d authored by Jonas Waeber's avatar 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
......@@ -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)
......
......@@ -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(
......
This diff is collapsed.
......@@ -7,8 +7,8 @@ app:
appDirectory: /memobase/test_record_set_1
fedora:
username: fedoraAdmin
password: ${FEDORA_PASSWORD:?system}
internalBaseUrl: http://localhost:8080/fcrepo/rest/
password: fedoraAdmin
internalBaseUrl: http://localhost:8081/fcrepo/rest/
externalBaseUrl: https://memobase.ch/
kafka:
consumer:
......
Supports Markdown
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