Due to a scheduled upgrade to version 14.10, GitLab will be unavailabe on Monday 30.05., from 19:00 until 20:00.

Commit 9da0d4d2 authored by Matthias's avatar Matthias
Browse files

make changres to read the correct files from sftp

parent e85da650
Pipeline #15815 failed with stages
in 50 seconds
......@@ -158,7 +158,7 @@ class KafkaTopology(private val settings: SettingsLoader) {
val fileExtensions = arrayOf("jpg", "jpeg", "png", "mp3", "mp4")
for (extension in fileExtensions) {
val filePath = data.first.second.recordSetId + "/" + value + "." + extension
val filePath = sftpBasePath + "/" + data.first.second.recordSetId + "/media/" + value + "." + extension
if (sftpClient.exists(filePath)) {
link = "${Constant.sftpPathPrefix}$filePath"
val literal = ResourceFactory.createPlainLiteral(link)
......
......@@ -18,6 +18,8 @@
package org.memobase
import com.beust.klaxon.Klaxon
import org.apache.kafka.common.header.internals.RecordHeader
import org.apache.kafka.common.header.internals.RecordHeaders
import java.io.File
import java.io.FileInputStream
import java.nio.charset.Charset
......@@ -73,8 +75,12 @@ class TestKafkaTopology {
val testDriver = TopologyTestDriver(service.builder.build(), service.settings.kafkaStreamsSettings)
val factory = ConsumerRecordFactory(StringSerializer(), StringSerializer())
val value = readFile(params.inputFileName)
val headers = RecordHeaders()
headers.add(RecordHeader("sessionId", "test-session-id".toByteArray()))
headers.add(RecordHeader("recordSetId", (service.settings.appSettings.getProperty(Constant.recordSetIdPropertyName.toString()).toByteArray())))
headers.add(RecordHeader("institutionId", "test-institution-id".toByteArray()))
testDriver.pipeInput(
factory.create(service.settings.inputTopic, params.key, value)
factory.create(service.settings.inputTopic, params.key, value, headers)
)
var record = testDriver.readOutput(
......
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