|
27 | 27 | import org.elasticsearch.cluster.block.ClusterBlocks; |
28 | 28 | import org.elasticsearch.cluster.metadata.IndexMetadata; |
29 | 29 | import org.elasticsearch.cluster.metadata.ProjectId; |
30 | | -import org.elasticsearch.cluster.project.ProjectResolver; |
31 | | -import org.elasticsearch.cluster.project.TestProjectResolvers; |
32 | 30 | import org.elasticsearch.cluster.service.ClusterService; |
33 | 31 | import org.elasticsearch.common.settings.ClusterSettings; |
34 | 32 | import org.elasticsearch.common.settings.Settings; |
@@ -89,12 +87,10 @@ public class GeoIpDownloaderTests extends ESTestCase { |
89 | 87 | private MockClient client; |
90 | 88 | private GeoIpDownloader geoIpDownloader; |
91 | 89 | private ProjectId projectId; |
92 | | - private ProjectResolver projectResolver; |
93 | 90 |
|
94 | 91 | @Before |
95 | 92 | public void setup() throws IOException { |
96 | 93 | projectId = randomProjectIdOrDefault(); |
97 | | - projectResolver = TestProjectResolvers.singleProject(projectId); |
98 | 94 | httpClient = mock(HttpClient.class); |
99 | 95 | when(httpClient.getBytes(anyString())).thenReturn("[]".getBytes(StandardCharsets.UTF_8)); |
100 | 96 | clusterService = mock(ClusterService.class); |
@@ -132,8 +128,7 @@ public void setup() throws IOException { |
132 | 128 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
133 | 129 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
134 | 130 | () -> true, |
135 | | - projectId, |
136 | | - projectResolver |
| 131 | + projectId |
137 | 132 | ) { |
138 | 133 | { |
139 | 134 | GeoIpTaskParams geoIpTaskParams = mock(GeoIpTaskParams.class); |
@@ -306,8 +301,7 @@ public void testProcessDatabaseNew() throws IOException { |
306 | 301 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
307 | 302 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
308 | 303 | () -> true, |
309 | | - projectId, |
310 | | - projectResolver |
| 304 | + projectId |
311 | 305 | ) { |
312 | 306 | @Override |
313 | 307 | protected void updateTimestamp(String name, GeoIpTaskState.Metadata metadata) { |
@@ -359,8 +353,7 @@ public void testProcessDatabaseUpdate() throws IOException { |
359 | 353 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
360 | 354 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
361 | 355 | () -> true, |
362 | | - projectId, |
363 | | - projectResolver |
| 356 | + projectId |
364 | 357 | ) { |
365 | 358 | @Override |
366 | 359 | protected void updateTimestamp(String name, GeoIpTaskState.Metadata metadata) { |
@@ -414,8 +407,7 @@ public void testProcessDatabaseSame() throws IOException { |
414 | 407 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
415 | 408 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
416 | 409 | () -> true, |
417 | | - projectId, |
418 | | - projectResolver |
| 410 | + projectId |
419 | 411 | ) { |
420 | 412 | @Override |
421 | 413 | protected void updateTimestamp(String name, GeoIpTaskState.Metadata newMetadata) { |
@@ -466,8 +458,7 @@ public void testCleanDatabases() throws IOException { |
466 | 458 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
467 | 459 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
468 | 460 | () -> true, |
469 | | - projectId, |
470 | | - projectResolver |
| 461 | + projectId |
471 | 462 | ) { |
472 | 463 | @Override |
473 | 464 | void updateDatabases() throws IOException { |
@@ -513,8 +504,7 @@ public void testUpdateTaskState() { |
513 | 504 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
514 | 505 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
515 | 506 | () -> true, |
516 | | - projectId, |
517 | | - projectResolver |
| 507 | + projectId |
518 | 508 | ) { |
519 | 509 | @Override |
520 | 510 | public void updatePersistentTaskState(PersistentTaskState state, ActionListener<PersistentTask<?>> listener) { |
@@ -545,8 +535,7 @@ public void testUpdateTaskStateError() { |
545 | 535 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
546 | 536 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
547 | 537 | () -> true, |
548 | | - projectId, |
549 | | - projectResolver |
| 538 | + projectId |
550 | 539 | ) { |
551 | 540 | @Override |
552 | 541 | public void updatePersistentTaskState(PersistentTaskState state, ActionListener<PersistentTask<?>> listener) { |
@@ -588,8 +577,7 @@ public void testUpdateDatabases() throws IOException { |
588 | 577 | () -> GeoIpDownloaderTaskExecutor.POLL_INTERVAL_SETTING.getDefault(Settings.EMPTY), |
589 | 578 | () -> GeoIpDownloaderTaskExecutor.EAGER_DOWNLOAD_SETTING.getDefault(Settings.EMPTY), |
590 | 579 | atLeastOneGeoipProcessor::get, |
591 | | - projectId, |
592 | | - projectResolver |
| 580 | + projectId |
593 | 581 | ) { |
594 | 582 | @Override |
595 | 583 | void processDatabase(Map<String, Object> databaseInfo) { |
|
0 commit comments