From 9979f395b1df2fde84ce873c03f0c5d8ea080560 Mon Sep 17 00:00:00 2001 From: Leopold Cramer Date: Fri, 26 Sep 2025 17:40:58 +0200 Subject: [PATCH] fix failing tests following RBAC changes 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 45bc21030..d376e0a1c 100644 --- a/organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt +++ b/organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt @@ -364,6 +364,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "organization", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -389,6 +390,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "workspace", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -414,6 +416,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "runner", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_EDITOR to mutableListOf( @@ -742,19 +745,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 { @@ -1316,6 +1306,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "organization", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -1341,6 +1332,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "workspace", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_USER to mutableListOf( @@ -1366,6 +1358,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() { component = "runner", roles = mutableMapOf( + ROLE_NONE to mutableListOf(), ROLE_VIEWER to mutableListOf(PERMISSION_READ), ROLE_EDITOR to mutableListOf( @@ -1769,19 +1762,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 {