Skip to content

Commit

Permalink
fixup! HAI-1527 Audit logging for permission updates
Browse files Browse the repository at this point in the history
  • Loading branch information
corvidian committed Aug 31, 2023
1 parent b8c53db commit 37cc429
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,11 @@ class HankeKayttajaServiceITest : DatabaseTest() {
.first()
.transform { it.message.auditEvent }
.all {
transform { it.target.type }.isEqualTo(ObjectType.PERMISSION)
transform { it.target.id }.isEqualTo(kayttaja.permission?.id.toString())
transform { it.operation }.isEqualTo(Operation.UPDATE)
transform { it.actor.role }.isEqualTo(UserRole.USER)
transform { it.actor.userId }.isEqualTo(USERNAME)
transform { it.target.id }.isEqualTo(kayttaja.permission?.id.toString())
transform { it.target.type }.isEqualTo(ObjectType.PERMISSION)
val permission = kayttaja.permission!!.toDomain()
transform { it.target.objectBefore }
.isEqualTo(permission.toChangeLogJsonString())
Expand Down Expand Up @@ -458,11 +458,11 @@ class HankeKayttajaServiceITest : DatabaseTest() {
.first()
.transform { it.message.auditEvent }
.all {
transform { it.target.type }.isEqualTo(ObjectType.KAYTTAJA_TUNNISTE)
transform { it.target.id }.isEqualTo(kayttaja.kayttajaTunniste?.id.toString())
transform { it.operation }.isEqualTo(Operation.UPDATE)
transform { it.actor.role }.isEqualTo(UserRole.USER)
transform { it.actor.userId }.isEqualTo(USERNAME)
transform { it.target.id }.isEqualTo(kayttaja.kayttajaTunniste?.id.toString())
transform { it.target.type }.isEqualTo(ObjectType.KAYTTAJA_TUNNISTE)
val tunniste =
kayttaja.kayttajaTunniste!!.toDomain().copy(hankeKayttajaId = kayttaja.id)
transform { it.target.objectBefore }.isEqualTo(tunniste.toChangeLogJsonString())
Expand Down

0 comments on commit 37cc429

Please sign in to comment.