Commit 103313c3 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add test for activity creation

Fix month formatting.
parent fd0504e1
Pipeline #37622 passed with stages
in 3 minutes and 8 seconds
......@@ -66,7 +66,7 @@ object Activity {
private fun now(): Literal {
return ResourceFactory.createTypedLiteral(
ZonedDateTime.now(ZoneId.of("UTC")).format(
DateTimeFormatter.ofPattern("YYYY-mm-dd'T'HH:mm:ssZ")
DateTimeFormatter.ofPattern("YYYY-MM-dd'T'HH:mm:ssZ")
).toString(), XSDDateTimeType("dateTime")
)
}
......
/*
Copyright 2020-2021 Jonas Waeber
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ch.memobase
import ch.memobase.helpers.Activity
import ch.memobase.rdf.MemobaseModel
import ch.memobase.rdf.RICO
import org.apache.jena.rdf.model.Statement
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class TestActivityObject {
@Test
fun `test activity object creation`() {
val memobaseModel = MemobaseModel()
val sourceCarrierType = memobaseModel.createRicoResource(RICO.CarrierType)
.addLiteral(RICO.name, "source")
val carrierType = memobaseModel.createRicoResource(RICO.CarrierType)
.addLiteral(RICO.name, "normalized")
Activity.appendActivity(carrierType, "testMechanism", sourceCarrierType, memobaseModel)
println(memobaseModel)
}
}
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