In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

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

Add tests for singel date issue.

parent 0e17c239
Pipeline #23068 passed with stage
in 3 minutes and 2 seconds
......@@ -15,7 +15,12 @@
package ch.memobase
import ch.memobase.configs.GlobalTransformsLoader
import ch.memobase.helpers.Date
import ch.memobase.rdf.MemobaseModel
import ch.memobase.rdf.RICO
import ch.memobase.rdf.RicoResource
import ch.memobase.transform.DateNormalizationTransform
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
......@@ -38,4 +43,28 @@ class TestDates {
fun `test year range normalization`() {
val value = "1911-1920"
val model = MemobaseModel()
val resource = RicoResource(
resource.addLiteral(RICO.expressedDate, value)
val transforms = GlobalTransformsLoader(TestUtils.pathGlobalTransformSettings).get()
val dateNormalizer = transforms.first { it is DateNormalizationTransform }
dateNormalizer as DateNormalizationTransform
dateNormalizer.transform(resource, model)
.satisfies {
assertThat(it.resource.hasLiteral(RICO.normalizedDateValue, "1911/1920"))
package ch.memobase
object TestUtils {
const val pathGlobalTransformSettings = "src/test/resources/global/transforms.yml"
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
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