88package org .elasticsearch .xpack .slm ;
99
1010import org .apache .lucene .util .SetOnce ;
11+ import org .elasticsearch .client .internal .Client ;
1112import org .elasticsearch .cluster .ClusterChangedEvent ;
1213import org .elasticsearch .cluster .ClusterName ;
1314import org .elasticsearch .cluster .ClusterState ;
3132import org .elasticsearch .core .TimeValue ;
3233import org .elasticsearch .test .ClusterServiceUtils ;
3334import org .elasticsearch .test .ESTestCase ;
35+ import org .elasticsearch .test .client .NoOpClient ;
3436import org .elasticsearch .threadpool .TestThreadPool ;
3537import org .elasticsearch .threadpool .ThreadPool ;
3638import org .elasticsearch .xpack .core .ilm .LifecycleSettings ;
@@ -129,7 +131,7 @@ public void testNothingScheduledWhenNotRunning() throws InterruptedException {
129131 ClusterService clusterService = ClusterServiceUtils .createClusterService (initialState , threadPool );
130132 SnapshotLifecycleService sls = new SnapshotLifecycleService (
131133 Settings .EMPTY ,
132- (projectId ) -> new FakeSnapshotTask (e -> logger .info ("triggered" )),
134+ (projectId ) -> new FakeSnapshotTask (e -> logger .info ("triggered" ), new NoOpClient ( threadPool ) ),
133135 clusterService ,
134136 clock
135137 )
@@ -198,7 +200,7 @@ public void testPolicyCRUD() throws Exception {
198200 ClusterService clusterService = ClusterServiceUtils .createClusterService (threadPool );
199201 SnapshotLifecycleService sls = new SnapshotLifecycleService (
200202 Settings .EMPTY ,
201- (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e )),
203+ (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e ), new NoOpClient ( threadPool ) ),
202204 clusterService ,
203205 clock
204206 )
@@ -329,7 +331,7 @@ public void testPolicyNamesEndingInNumbers() throws Exception {
329331 ClusterService clusterService = ClusterServiceUtils .createClusterService (threadPool );
330332 SnapshotLifecycleService sls = new SnapshotLifecycleService (
331333 Settings .EMPTY ,
332- (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e )),
334+ (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e ), new NoOpClient ( threadPool ) ),
333335 clusterService ,
334336 clock
335337 )
@@ -509,7 +511,7 @@ public void submitUnbatchedStateUpdateTask(String source, ClusterStateUpdateTask
509511
510512 SnapshotLifecycleService service = new SnapshotLifecycleService (
511513 Settings .EMPTY ,
512- (projectId ) -> new SnapshotLifecycleTask (projectId , null , null , null ),
514+ (projectId ) -> new SnapshotLifecycleTask (projectId , new NoOpClient ( threadPool ) , null , null ),
513515 fakeService ,
514516 clock
515517 );
@@ -529,8 +531,8 @@ public void submitUnbatchedStateUpdateTask(String source, ClusterStateUpdateTask
529531 class FakeSnapshotTask extends SnapshotLifecycleTask {
530532 private final Consumer <SchedulerEngine .Event > onTriggered ;
531533
532- FakeSnapshotTask (Consumer <SchedulerEngine .Event > onTriggered ) {
533- super (projectId , null , null , null );
534+ FakeSnapshotTask (Consumer <SchedulerEngine .Event > onTriggered , Client client ) {
535+ super (projectId , client , null , null );
534536 this .onTriggered = onTriggered ;
535537 }
536538
0 commit comments