Skip to content

Commit 8886393

Browse files
fix failing tests following RBAC changes in commons
1 parent 534bff5 commit 8886393

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

organization/src/integrationTest/kotlin/com/cosmotech/organization/service/OrganizationServiceIntegrationTest.kt

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
364364
component = "organization",
365365
roles =
366366
mutableMapOf(
367+
ROLE_NONE to mutableListOf<String>(),
367368
ROLE_VIEWER to mutableListOf(PERMISSION_READ),
368369
ROLE_USER to
369370
mutableListOf(
@@ -389,6 +390,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
389390
component = "workspace",
390391
roles =
391392
mutableMapOf(
393+
ROLE_NONE to mutableListOf<String>(),
392394
ROLE_VIEWER to mutableListOf(PERMISSION_READ),
393395
ROLE_USER to
394396
mutableListOf(
@@ -414,6 +416,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
414416
component = "runner",
415417
roles =
416418
mutableMapOf(
419+
ROLE_NONE to mutableListOf<String>(),
417420
ROLE_VIEWER to mutableListOf(PERMISSION_READ),
418421
ROLE_EDITOR to
419422
mutableListOf(
@@ -742,19 +745,6 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
742745
}
743746
}
744747

745-
@Test
746-
fun `addOrganizationAccessControl as resource admin (ROLE_NONE)`() {
747-
assertThrows<CsmClientException> {
748-
val name = "o-connector-test-1"
749-
val organizationRegistered =
750-
organizationApiService.registerOrganization(createTestOrganization(name))
751-
752-
val otherUserACL = OrganizationAccessControl(id = OTHER_TEST_USER_ID, role = ROLE_NONE)
753-
organizationApiService.addOrganizationAccessControl(
754-
organizationRegistered.id!!, otherUserACL)
755-
}
756-
}
757-
758748
@Test
759749
fun `addOrganizationAccessControl as not resource admin and PERMISSION_WRITE_SECURITY`() {
760750
assertDoesNotThrow {
@@ -1316,6 +1306,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
13161306
component = "organization",
13171307
roles =
13181308
mutableMapOf(
1309+
ROLE_NONE to mutableListOf<String>(),
13191310
ROLE_VIEWER to mutableListOf(PERMISSION_READ),
13201311
ROLE_USER to
13211312
mutableListOf(
@@ -1341,6 +1332,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
13411332
component = "workspace",
13421333
roles =
13431334
mutableMapOf(
1335+
ROLE_NONE to mutableListOf<String>(),
13441336
ROLE_VIEWER to mutableListOf(PERMISSION_READ),
13451337
ROLE_USER to
13461338
mutableListOf(
@@ -1366,6 +1358,7 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
13661358
component = "runner",
13671359
roles =
13681360
mutableMapOf(
1361+
ROLE_NONE to mutableListOf<String>(),
13691362
ROLE_VIEWER to mutableListOf(PERMISSION_READ),
13701363
ROLE_EDITOR to
13711364
mutableListOf(
@@ -1769,19 +1762,6 @@ class OrganizationServiceIntegrationTest : CsmRedisTestBase() {
17691762
}
17701763
}
17711764

1772-
@Test
1773-
fun `addOrganizationAccessControl as resource admin (ROLE_NONE)`() {
1774-
assertThrows<CsmClientException> {
1775-
val name = "o-connector-test-1"
1776-
val organizationRegistered =
1777-
organizationApiService.registerOrganization(createTestOrganization(name))
1778-
1779-
val otherUserACL = OrganizationAccessControl(id = OTHER_TEST_USER_ID, role = ROLE_NONE)
1780-
organizationApiService.addOrganizationAccessControl(
1781-
organizationRegistered.id!!, otherUserACL)
1782-
}
1783-
}
1784-
17851765
@Test
17861766
fun `addOrganizationAccessControl as not resource admin and PERMISSION_WRITE_SECURITY`() {
17871767
assertDoesNotThrow {

0 commit comments

Comments
 (0)