Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(resource): return sensible CreationDate for DeletedResource (#1979)
  • Loading branch information
BalduinLandolt committed Jan 17, 2022
1 parent e590d12 commit 1658103
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -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
)
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 1658103

Please sign in to comment.