Skip to content
Permalink
Browse files
fix(resource): return sensible CreationDate for DeletedResource (#1979)
  • Loading branch information
BalduinLandolt committed Jan 17, 2022
1 parent e590d12 commit 1658103d27051b5920b68b01f6b863be7c55e5ab
@@ -556,8 +556,8 @@ case class ReadResourceV2(
permissions = this.permissions,
userPermission = this.userPermission,
values = Map.empty,
creationDate = Instant.now(),
lastModificationDate = None,
creationDate = this.creationDate,
lastModificationDate = this.lastModificationDate,
versionDate = None,
deletionInfo = this.deletionInfo
)
@@ -53,6 +53,7 @@ object ResourcesResponderV2Spec {

private val aThingIri = "http://rdfh.ch/0001/a-thing"
private var aThingLastModificationDate = Instant.now
private val aThingCreationDate = Instant.parse("2016-03-02T15:05:10Z")

private val resourceIriToErase = new MutableTestIri
private val firstValueIriToErase = new MutableTestIri
@@ -1971,6 +1972,8 @@ class ResourcesResponderV2Spec extends CoreSpec() with ImplicitSender {
val resource = response.resources.head
resource.resourceClassIri should equal(OntologyConstants.KnoraBase.DeletedResource.toSmartIri)
resource.deletionInfo should not be (None)
resource.lastModificationDate should not be (None)
resource.creationDate should equal(aThingCreationDate)
println(resource)
}
}

0 comments on commit 1658103

Please sign in to comment.