Selaa lähdekoodia

[Test] Fix CompositeRolesStoreTests testCacheCleanupOnProjectDeletion (#132168)

Resolves #132158 Resolves #132218
Slobodan Adamović 2 kuukautta sitten
vanhempi
commit
892d88b381

+ 1 - 4
muted-tests.yml

@@ -518,9 +518,6 @@ tests:
 - class: org.elasticsearch.indices.cluster.FieldCapsForceConnectTimeoutIT
   method: testTimeoutSetting
   issue: https://github.com/elastic/elasticsearch/issues/132179
-- class: org.elasticsearch.xpack.security.authz.store.CompositeRolesStoreTests
-  method: testCacheCleanupOnProjectDeletion
-  issue: https://github.com/elastic/elasticsearch/issues/132218
 - class: org.elasticsearch.test.rest.yaml.MDPYamlTestSuiteIT
   method: test {yaml=mdp/10_basic/Index using shared data path}
   issue: https://github.com/elastic/elasticsearch/issues/132223
@@ -571,4 +568,4 @@ tests:
 #    issue: "https://github.com/elastic/elasticsearch/..."
 #  - class: "org.elasticsearch.xpack.esql.**"
 #    method: "test {union_types.MultiIndexIpStringStatsInline *}"
-#    issue: "https://github.com/elastic/elasticsearch/..."
+#    issue: "https://github.com/elastic/elasticsearch/..."

+ 2 - 7
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java

@@ -2313,11 +2313,6 @@ public class CompositeRolesStoreTests extends ESTestCase {
         doCallRealMethod().when(fileRolesStore).accept(anySet(), anyActionListener());
         when(fileRolesStore.roleDescriptors(anySet())).thenReturn(Set.of(roleDescriptor));
 
-        final NativeRolesStore nativeRolesStore = mock(NativeRolesStore.class);
-        doCallRealMethod().when(nativeRolesStore).accept(anySet(), anyActionListener());
-        final ReservedRolesStore reservedRolesStore = mock(ReservedRolesStore.class);
-        doCallRealMethod().when(reservedRolesStore).accept(anySet(), anyActionListener());
-
         final AtomicReference<ProjectId> projectId = new AtomicReference<>(ProjectId.DEFAULT);
         final ProjectResolver projectResolver = TestProjectResolvers.singleProject(projectId::get);
 
@@ -2325,8 +2320,8 @@ public class CompositeRolesStoreTests extends ESTestCase {
             Settings.EMPTY,
             clusterService,
             fileRolesStore,
-            nativeRolesStore,
-            reservedRolesStore,
+            null,
+            null,
             null,
             null,
             null,