From 83bddf23cd98a3b1c3a11f61fe62e703efe8f484 Mon Sep 17 00:00:00 2001 From: Leopold Cramer Date: Fri, 26 Sep 2025 17:18:41 +0200 Subject: [PATCH] fix broken tests due to RBAC modification in commons --- .../OrganizationServiceIntegrationTest.kt | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt b/organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt index 13ad683c3..333c7e4b8 100644 --- a/organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt +++ b/organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt @@ -621,6 +621,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "organization", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -646,6 +647,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "workspace", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -671,6 +673,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "scenario", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_EDITOR to mutableListOf( @@ -999,19 +1002,6 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { } } - @Test - fun `addOrganizationAccessControl as resource admin (ROLE_NONE)`() { - assertThrows { - val name = "o-connector-test-1" - val organizationRegistered = - organizationApiService.registerOrganization(createTestOrganization(name)) - - val otherUserACL = OrganizationAccessControl(id = OTHER_TEST_USER_ID, role = ROLE_NONE) - organizationApiService.addOrganizationAccessControl( - organizationRegistered.id!!, otherUserACL) - } - } - @Test fun `addOrganizationAccessControl as not resource admin and PERMISSION_WRITE_SECURITY`() { assertDoesNotThrow { @@ -1845,6 +1835,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "organization", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -1870,6 +1861,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "workspace", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -1895,6 +1887,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "scenario", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_EDITOR to mutableListOf( @@ -2298,19 +2291,6 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { } } - @Test - fun `addOrganizationAccessControl as resource admin (ROLE_NONE)`() { - assertThrows { - val name = "o-connector-test-1" - val organizationRegistered = - organizationApiService.registerOrganization(createTestOrganization(name)) - - val otherUserACL = OrganizationAccessControl(id = OTHER_TEST_USER_ID, role = ROLE_NONE) - organizationApiService.addOrganizationAccessControl( - organizationRegistered.id!!, otherUserACL) - } - } - @Test fun `addOrganizationAccessControl as not resource admin and PERMISSION_WRITE_SECURITY`() { assertDoesNotThrow {