Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Resource): return sensible CreationDate for DeletedResource (DEV-375) #1979

Merged
merged 4 commits into from Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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