Commit c2bf592b authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix tests

parent 7538acac
Pipeline #16097 passed with stage
in 2 minutes and 2 seconds
......@@ -39,7 +39,7 @@ import params.EntitySplitterParams
import java.io.File
import java.nio.charset.Charset
import java.util.stream.Stream
import kotlin.test.assertEquals
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class TestTransformers {
......@@ -101,11 +101,11 @@ class TestTransformers {
results.sortBy { value -> value.getStringLiteral(params.splitterLiteral) }
assertAll("entity splitter tests",
{ assertEquals(2, results.size) },
{ assertEquals(true, results[0].hasProperty(params.splitterLiteral, params.splitValues[0])) },
{ assertEquals(true, results[1].hasProperty(params.splitterLiteral, params.splitValues[1])) },
{ assertEquals(2, record.listProperties(params.recordToEntity).toList().size) },
{ assertEquals(emptyList(), result) }
{ assertThat(results.size).isEqualTo(2) },
{ assertThat(results[0].hasProperty(params.splitterLiteral, params.splitValues[0])).isTrue() },
{ assertThat(results[1].hasProperty(params.splitterLiteral, params.splitValues[1])).isTrue() },
{ assertThat(record.listProperties(params.recordToEntity).toList().size).isEqualTo(2) },
{ assertThat(result).isEmpty() }
)
}
......@@ -154,16 +154,15 @@ class TestTransformers {
results.sortBy { value -> value.getProperty(RICO.name).string }
assertAll("entity splitter tests",
{ assertEquals(2, results.size) },
{ assertEquals(true, results[0].hasProperty(RICO.name, "Test Person 1")) },
{ assertEquals(true, results[1].hasProperty(RICO.name, "Test Person 2")) },
{ assertThat(results.size).isEqualTo(2) },
{ assertThat(results[0].hasProperty(RICO.name, "Test Person 1")).isTrue() },
{ assertThat(results[1].hasProperty(RICO.name, "Test Person 2")).isTrue() },
{
assertEquals(
2,
assertThat(
record.listProperties(RICO.recordResourceOrInstantiationIsSourceOfCreationRelation).toList().size
)
).isEqualTo(2)
},
{ assertEquals(emptyList(), result) }
{ assertThat(result).isEmpty() }
)
}
......@@ -185,10 +184,10 @@ class TestTransformers {
results.sortBy { value -> value.getStringLiteral(SKOS.prefLabel) }
assertAll("entity splitter tests",
{ assertEquals(1, results.size) },
{ assertEquals(true, results[0].hasProperty(SKOS.prefLabel, "subject1, subject2")) },
{ assertEquals(1, record.listProperties(RICO.hasSubject).toList().size) },
{ assertEquals(emptyList(), result) }
{ assertThat(results.size).isEqualTo(1) },
{ assertThat(results[0].hasProperty(SKOS.prefLabel, "subject1, subject2")).isTrue() },
{ assertThat(record.listProperties(RICO.hasSubject).toList().size).isEqualTo(1) },
{ assertThat(result).isEmpty() }
)
}
......@@ -210,11 +209,11 @@ class TestTransformers {
results.sortBy { value -> value.getStringLiteral(SKOS.prefLabel) }
assertAll("entity splitter tests",
{ assertEquals(2, results.size) },
{ assertEquals(true, results[0].hasProperty(SKOS.prefLabel, "subject1")) },
{ assertEquals(true, results[1].hasProperty(SKOS.prefLabel, "subject2")) },
{ assertEquals(2, record.listProperties(RICO.hasSubject).toList().size) },
{ assertEquals(emptyList(), result) }
{ assertThat(results.size).isEqualTo(2) },
{ assertThat(results[0].hasProperty(SKOS.prefLabel, "subject1")).isTrue() },
{ assertThat(results[1].hasProperty(SKOS.prefLabel, "subject2")).isTrue() },
{ assertThat(record.listProperties(RICO.hasSubject).toList().size).isEqualTo(2) },
{ assertThat(result).isEmpty() }
)
}
......@@ -232,9 +231,9 @@ class TestTransformers {
val result = normalizer.transform(person, model)
assertAll("person normalizer tests",
{ assertEquals(params.hasFirstName, person.hasProperty(FOAF.firstName, params.firstName)) },
{ assertEquals(params.hasLastName, person.hasProperty(FOAF.lastName, params.lastName)) },
{ assertEquals(emptyList(), result) }
{ assertThat(person.hasProperty(FOAF.firstName, params.firstName)).isEqualTo(params.hasFirstName) },
{ assertThat(person.hasProperty(FOAF.lastName, params.lastName)).isEqualTo(params.hasLastName) },
{ assertThat(result).isEmpty() }
)
}
......
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