Commit 1d6f483d authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix test for valid input.

parent 07f6650a
Pipeline #8701 passed with stages
in 6 minutes and 37 seconds
......@@ -59,9 +59,9 @@ class Tests {
}
private val configTestBasePath = "src/test/resources/configTests/"
/*
/*
@Test
fun `test mapping config parser`() {
fun `json-ld data export for record sets`() {
val config =
MappingConfig("src/test/resources/multifileconfig")
var count = 0
......@@ -87,9 +87,9 @@ class Tests {
}
}
}
}
*/
}*/
private val regex = Regex("(_:B[A-Za-z0-9]+)")
@Test
fun `test kafka topology`() {
val settings = SettingsLoader(
......@@ -101,9 +101,6 @@ class Tests {
fileName = "kafkaTest1.yml",
useStreamsConfig = true
)
val topology = KafkaTopology(settings).build()
val stream = KafkaStreams(topology, settings.kafkaStreamsSettings)
val testDriver = TopologyTestDriver(KafkaTopology(settings).build(), settings.kafkaStreamsSettings)
val factory = ConsumerRecordFactory(
StringSerializer(), StringSerializer()
......@@ -120,16 +117,22 @@ class Tests {
StringDeserializer()
)
val sortedResult = record.value().lines().sorted().reduce { acc, s -> acc + "\n" + s }
val sortedResult = record.value().lines().map {
var replacedString = it
for (matchResult in regex.findAll(it)) {
replacedString = replacedString.replace(matchResult.groups[0]?.value.orEmpty(), "_:B")
}
replacedString
}.sorted().reduce { acc, s -> acc + "\n" + s }
assertThat(record)
.isNotNull
.hasFieldOrPropertyWithValue("key", "https://memobase.ch/record/BAZ-MEI_49884")
// TODO: find a way to test output. the problem is, that the generated blank node ids are different each time.
// one possibilty would be to use and sort a json document as there the keys are deterministic. maybe. or maybe not...
//assertThat(sortedResult)
// .isEqualTo(readFile("kafkaTests/1/output.nt"))
assertThat(sortedResult)
.isEqualTo(readFile("kafkaTests/1/output.nt"))
}
......
<https://memobase.ch/record/BAZ-MEI_49884> <http://purl.org/dc/terms/created> _:B822e9b36X2Db650X2D40f3X2Db910X2D713f0d193878 .
<https://memobase.ch/record/BAZ-MEI_49884> <http://purl.org/dc/terms/created> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <http://rdaregistry.info/Elements/u/P60262> "Auftragsregister Bd. 6; Bildverzeichnis Bd. 7" .
<https://memobase.ch/record/BAZ-MEI_49884> <http://rdaregistry.info/Elements/u/P60451> "Memoriav" .
<https://memobase.ch/record/BAZ-MEI_49884> <http://rdaregistry.info/Elements/u/P60556> _:B16bf53adX2De0bcX2D4ab2X2D9474X2Db06e2e0b78b9 .
<https://memobase.ch/record/BAZ-MEI_49884> <http://rdaregistry.info/Elements/u/P60556> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Record> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "Villa mit Garten und Brunnen im Vordergrund. Vermutlich von Architekt Walz"@de .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#hasInstantiation> <https://memobase.ch/instatiation/physical/BAZ-MEI_49884-0> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/BAZ> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#hasTitle> _:B1ac133b7X2D5a94X2D4873X2D9d62X2D1a2c25cd849f .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#hasTitle> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#heldBy> <https://memobase.ch/institution/BAZ> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B85880060X2D648dX2D4d18X2Db313X2D0db3f3185f25 .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B90b39583X2D9977X2D4312X2Db95dX2Dec0250c89599 .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#isPartOf> <https://memobase.ch/recordSet/BAZ-B_MEI> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#recordResourceOrInstantiationIsSourceOfCreationRelation> _:Bcc33847aX2D48c6X2D450aX2Dafc6X2D3808bd8977a6 .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#recordResourceOrInstantiationIsSourceOfCreationRelation> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#title> "«Villa Siegel», Zürich"@de .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#type> "Foto" .
_:B16bf53adX2De0bcX2D4ab2X2D9474X2Db06e2e0b78b9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Place> .
_:B16bf53adX2De0bcX2D4ab2X2D9474X2Db06e2e0b78b9 <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/BAZ> .
_:B16bf53adX2De0bcX2D4ab2X2D9474X2Db06e2e0b78b9 <https://www.ica.org/standards/RiC/ontology#name> "Zürich"@de .
_:B1ac133b7X2D5a94X2D4873X2D9d62X2D1a2c25cd849f <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Title> .
_:B1ac133b7X2D5a94X2D4873X2D9d62X2D1a2c25cd849f <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/BAZ> .
_:B1ac133b7X2D5a94X2D4873X2D9d62X2D1a2c25cd849f <https://www.ica.org/standards/RiC/ontology#isTitleOf> <https://memobase.ch/record/BAZ-MEI_49884> .
_:B1ac133b7X2D5a94X2D4873X2D9d62X2D1a2c25cd849f <https://www.ica.org/standards/RiC/ontology#title> "«Villa Siegel», Zürich"@de .
_:B1ac133b7X2D5a94X2D4873X2D9d62X2D1a2c25cd849f <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B822e9b36X2Db650X2D40f3X2Db910X2D713f0d193878 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#DateSet> .
_:B822e9b36X2Db650X2D40f3X2Db910X2D713f0d193878 <https://www.ica.org/standards/RiC/ontology#expressedDate> "19210914" .
_:B85880060X2D648dX2D4d18X2Db313X2D0db3f3185f25 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B85880060X2D648dX2D4d18X2Db313X2D0db3f3185f25 <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/Memoriav> .
_:B85880060X2D648dX2D4d18X2Db313X2D0db3f3185f25 <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/BAZ-MEI_49884" .
_:B85880060X2D648dX2D4d18X2Db313X2D0db3f3185f25 <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B90b39583X2D9977X2D4312X2Db95dX2Dec0250c89599 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B90b39583X2D9977X2D4312X2Db95dX2Dec0250c89599 <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/BAZ> .
_:B90b39583X2D9977X2D4312X2Db95dX2Dec0250c89599 <https://www.ica.org/standards/RiC/ontology#identifier> "MEI_49884" .
_:B90b39583X2D9977X2D4312X2Db95dX2Dec0250c89599 <https://www.ica.org/standards/RiC/ontology#type> "callNumber" .
_:Baa76f150X2D4728X2D489aX2Dbef7X2D147a0f9086e9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Agent> .
_:Baa76f150X2D4728X2D489aX2Dbef7X2D147a0f9086e9 <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/BAZ> .
_:Baa76f150X2D4728X2D489aX2Dbef7X2D147a0f9086e9 <https://www.ica.org/standards/RiC/ontology#name> "Walz"@de .
_:Bcc33847aX2D48c6X2D450aX2Dafc6X2D3808bd8977a6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#CreationRelation> .
_:Bcc33847aX2D48c6X2D450aX2Dafc6X2D3808bd8977a6 <https://www.ica.org/standards/RiC/ontology#creationRelationHasSource> <https://memobase.ch/record/BAZ-MEI_49884> .
_:Bcc33847aX2D48c6X2D450aX2Dafc6X2D3808bd8977a6 <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:Baa76f150X2D4728X2D489aX2Dbef7X2D147a0f9086e9 .
_:Bcc33847aX2D48c6X2D450aX2Dafc6X2D3808bd8977a6 <https://www.ica.org/standards/RiC/ontology#hasProvenance> <https://memobase.ch/institution/BAZ> .
_:Bcc33847aX2D48c6X2D450aX2Dafc6X2D3808bd8977a6 <https://www.ica.org/standards/RiC/ontology#type> "Auftraggeber" .
\ No newline at end of file
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Agent> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#CreationRelation> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#DateSet> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Place> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Title> .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasSource> <https://memobase.ch/record/BAZ-MEI_49884> .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#expressedDate> "19210914" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "MEI_49884" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/BAZ-MEI_49884" .
_:B <https://www.ica.org/standards/RiC/ontology#isTitleOf> <https://memobase.ch/record/BAZ-MEI_49884> .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Walz"@de .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Zürich"@de .
_:B <https://www.ica.org/standards/RiC/ontology#title> "«Villa Siegel», Zürich"@de .
_:B <https://www.ica.org/standards/RiC/ontology#type> "Auftraggeber" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "callNumber" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
\ No newline at end of file
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