From 37cc42966246ded7a10ac18ef7d76d509b324d04 Mon Sep 17 00:00:00 2001 From: Topias Heinonen Date: Thu, 31 Aug 2023 12:32:19 +0300 Subject: [PATCH] fixup! HAI-1527 Audit logging for permission updates --- .../hanke/permissions/HankeKayttajaServiceITest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/permissions/HankeKayttajaServiceITest.kt b/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/permissions/HankeKayttajaServiceITest.kt index f0d050f2b..67ee4e0af 100644 --- a/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/permissions/HankeKayttajaServiceITest.kt +++ b/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/permissions/HankeKayttajaServiceITest.kt @@ -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()) @@ -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())