11package io .weaviate .integration ;
22
33import java .io .IOException ;
4- import java .util .Arrays ;
4+ import java .util .List ;
55
66import org .assertj .core .api .Assertions ;
77import org .assertj .core .api .InstanceOfAssertFactories ;
@@ -64,19 +64,22 @@ public void test_roles_Lifecycle() throws IOException {
6464 var myCollection = "Things" ;
6565 var nsRole = ns ("VectorOwner" );
6666
67- Permission [] permissions = new Permission [] {
67+ List < Permission > permissions = List . of (
6868 Permission .aliases ("ThingsAlias" , myCollection , AliasesPermission .Action .CREATE ),
6969 Permission .backups (myCollection , BackupsPermission .Action .MANAGE ),
7070 Permission .cluster (ClusterPermission .Action .READ ),
7171 Permission .nodes (myCollection , NodesPermission .Action .READ ),
7272 Permission .roles (VIEWER_ROLE , Scope .MATCH , RolesPermission .Action .CREATE ),
7373 Permission .collections (myCollection , CollectionsPermission .Action .CREATE ),
7474 Permission .data (myCollection , DataPermission .Action .UPDATE ),
75- Permission .groups ("my-group" , GroupType .OIDC , GroupsPermission .Action .READ ),
7675 Permission .tenants (myCollection , "my-tenant" , TenantsPermission .Action .DELETE ),
7776 Permission .users ("my-user" , UsersPermission .Action .READ ),
78- Permission .replicate (myCollection , "my-shard" , ReplicatePermission .Action .READ ),
79- };
77+ Permission .replicate (myCollection , "my-shard" , ReplicatePermission .Action .READ ));
78+
79+ requireAtLeast (1 , 33 , () -> {
80+ permissions .add (
81+ Permission .groups ("my-group" , GroupType .OIDC , GroupsPermission .Action .READ ));
82+ });
8083
8184 // Act: create role
8285 client .roles .create (nsRole , permissions );
@@ -86,7 +89,7 @@ public void test_roles_Lifecycle() throws IOException {
8689 .as ("created role" )
8790 .returns (nsRole , Role ::name )
8891 .extracting (Role ::permissions , InstanceOfAssertFactories .list (Permission .class ))
89- .containsAll (Arrays . asList ( permissions ) );
92+ .containsAll (permissions );
9093
9194 // Act:: add extra permissions
9295 var extra = new Permission [] {
@@ -150,6 +153,8 @@ public void test_roles_userAssignments() throws IOException {
150153
151154 @ Test
152155 public void test_groups () throws IOException {
156+ requireAtLeast (1 , 33 );
157+
153158 var mediaGroup = "./media-group" ;
154159 var friendGroup = "./friend-group" ;
155160
0 commit comments