8
8
package org .elasticsearch .xpack .slm ;
9
9
10
10
import org .apache .lucene .util .SetOnce ;
11
+ import org .elasticsearch .client .internal .Client ;
11
12
import org .elasticsearch .cluster .ClusterChangedEvent ;
12
13
import org .elasticsearch .cluster .ClusterName ;
13
14
import org .elasticsearch .cluster .ClusterState ;
31
32
import org .elasticsearch .core .TimeValue ;
32
33
import org .elasticsearch .test .ClusterServiceUtils ;
33
34
import org .elasticsearch .test .ESTestCase ;
35
+ import org .elasticsearch .test .client .NoOpClient ;
34
36
import org .elasticsearch .threadpool .TestThreadPool ;
35
37
import org .elasticsearch .threadpool .ThreadPool ;
36
38
import org .elasticsearch .xpack .core .ilm .LifecycleSettings ;
@@ -129,7 +131,7 @@ public void testNothingScheduledWhenNotRunning() throws InterruptedException {
129
131
ClusterService clusterService = ClusterServiceUtils .createClusterService (initialState , threadPool );
130
132
SnapshotLifecycleService sls = new SnapshotLifecycleService (
131
133
Settings .EMPTY ,
132
- (projectId ) -> new FakeSnapshotTask (e -> logger .info ("triggered" )),
134
+ (projectId ) -> new FakeSnapshotTask (e -> logger .info ("triggered" ), new NoOpClient ( threadPool ) ),
133
135
clusterService ,
134
136
clock
135
137
)
@@ -198,7 +200,7 @@ public void testPolicyCRUD() throws Exception {
198
200
ClusterService clusterService = ClusterServiceUtils .createClusterService (threadPool );
199
201
SnapshotLifecycleService sls = new SnapshotLifecycleService (
200
202
Settings .EMPTY ,
201
- (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e )),
203
+ (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e ), new NoOpClient ( threadPool ) ),
202
204
clusterService ,
203
205
clock
204
206
)
@@ -329,7 +331,7 @@ public void testPolicyNamesEndingInNumbers() throws Exception {
329
331
ClusterService clusterService = ClusterServiceUtils .createClusterService (threadPool );
330
332
SnapshotLifecycleService sls = new SnapshotLifecycleService (
331
333
Settings .EMPTY ,
332
- (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e )),
334
+ (projectId ) -> new FakeSnapshotTask (e -> trigger .get ().accept (e ), new NoOpClient ( threadPool ) ),
333
335
clusterService ,
334
336
clock
335
337
)
@@ -509,7 +511,7 @@ public void submitUnbatchedStateUpdateTask(String source, ClusterStateUpdateTask
509
511
510
512
SnapshotLifecycleService service = new SnapshotLifecycleService (
511
513
Settings .EMPTY ,
512
- (projectId ) -> new SnapshotLifecycleTask (projectId , null , null , null ),
514
+ (projectId ) -> new SnapshotLifecycleTask (projectId , new NoOpClient ( threadPool ) , null , null ),
513
515
fakeService ,
514
516
clock
515
517
);
@@ -529,8 +531,8 @@ public void submitUnbatchedStateUpdateTask(String source, ClusterStateUpdateTask
529
531
class FakeSnapshotTask extends SnapshotLifecycleTask {
530
532
private final Consumer <SchedulerEngine .Event > onTriggered ;
531
533
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 );
534
536
this .onTriggered = onTriggered ;
535
537
}
536
538
0 commit comments