From d50ffd6dc3b69e3093c5c2a42c841d608af72c85 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 13 Jan 2017 16:51:28 +0100 Subject: [PATCH] Fix compilation after elastic/elasticsearchelastic/elasticsearch#22608 Original commit: elastic/x-pack-elasticsearch@5ce843283a0e77a9f7671edcbb3e98a9c3864431 --- .../action/TransportXPackInfoActionTests.java | 2 +- .../action/TransportMonitoringBulkActionTests.java | 8 ++++---- .../role/TransportDeleteRoleActionTests.java | 6 +++--- .../action/role/TransportGetRolesActionTests.java | 8 ++++---- .../action/role/TransportPutRoleActionTests.java | 6 +++--- .../user/TransportAuthenticateActionTests.java | 6 +++--- .../user/TransportChangePasswordActionTests.java | 8 ++++---- .../user/TransportDeleteUserActionTests.java | 10 +++++----- .../action/user/TransportGetUsersActionTests.java | 14 ++++++-------- .../action/user/TransportPutUserActionTests.java | 10 +++++----- .../user/TransportSetEnabledActionTests.java | 10 +++++----- 11 files changed, 43 insertions(+), 45 deletions(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/action/TransportXPackInfoActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/action/TransportXPackInfoActionTests.java index 23287d0dd68..97bfd7c76e9 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/action/TransportXPackInfoActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/action/TransportXPackInfoActionTests.java @@ -53,7 +53,7 @@ public class TransportXPackInfoActionTests extends ESTestCase { } TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportXPackInfoAction action = new TransportXPackInfoAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), licenseService, featureSets); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java index 5e5665963ac..0b5b7a8b77a 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java @@ -91,11 +91,11 @@ public class TransportMonitoringBulkActionTests extends ESTestCase { Set> clusterSettings = new HashSet<>(); clusterSettings.addAll(ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); clusterSettings.add(MonitoringSettings.EXPORTERS_SETTINGS); + final DiscoveryNode node = new DiscoveryNode("node", buildNewFakeTransportAddress(), emptyMap(), emptySet(), + Version.CURRENT); clusterService = new ClusterService(Settings.builder().put("cluster.name", TransportMonitoringBulkActionTests.class.getName()).build(), - new ClusterSettings(Settings.EMPTY, clusterSettings), threadPool); - clusterService.setLocalNode(new DiscoveryNode("node", buildNewFakeTransportAddress(), emptyMap(), emptySet(), - Version.CURRENT)); + new ClusterSettings(Settings.EMPTY, clusterSettings), threadPool, () -> node); clusterService.setNodeConnectionsService(new NodeConnectionsService(Settings.EMPTY, null, null) { @Override public void connectToNodes(Iterable discoveryNodes) { @@ -113,7 +113,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase { clusterService.start(); transportService = new TransportService(clusterService.getSettings(), transport, threadPool, - TransportService.NOOP_TRANSPORT_INTERCEPTOR, null); + TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> node, null); transportService.start(); transportService.acceptIncomingRequests(); exportService = new CapturingExporters(); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportDeleteRoleActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportDeleteRoleActionTests.java index af002184a97..cb9b51ad0f8 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportDeleteRoleActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportDeleteRoleActionTests.java @@ -41,7 +41,7 @@ public class TransportDeleteRoleActionTests extends ESTestCase { final String roleName = randomFrom(new ArrayList<>(ReservedRolesStore.names())); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + (x) -> null, null); TransportDeleteRoleAction action = new TransportDeleteRoleAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService); @@ -72,7 +72,7 @@ public class TransportDeleteRoleActionTests extends ESTestCase { final String roleName = randomFrom("admin", "dept_a", "restricted"); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + (x) -> null, null); TransportDeleteRoleAction action = new TransportDeleteRoleAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService); @@ -116,7 +116,7 @@ public class TransportDeleteRoleActionTests extends ESTestCase { final String roleName = randomFrom("admin", "dept_a", "restricted"); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + (x) -> null, null); TransportDeleteRoleAction action = new TransportDeleteRoleAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportGetRolesActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportGetRolesActionTests.java index 7d1dd1d79e1..457a3dd3fd4 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportGetRolesActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportGetRolesActionTests.java @@ -42,7 +42,7 @@ public class TransportGetRolesActionTests extends ESTestCase { public void testReservedRoles() { NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetRolesAction action = new TransportGetRolesAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService, new ReservedRolesStore()); @@ -88,7 +88,7 @@ public class TransportGetRolesActionTests extends ESTestCase { final List storeRoleDescriptors = randomRoleDescriptors(); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetRolesAction action = new TransportGetRolesAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService, new ReservedRolesStore()); @@ -140,7 +140,7 @@ public class TransportGetRolesActionTests extends ESTestCase { NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetRolesAction action = new TransportGetRolesAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService, new ReservedRolesStore()); @@ -204,7 +204,7 @@ public class TransportGetRolesActionTests extends ESTestCase { final List storeRoleDescriptors = randomRoleDescriptors(); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetRolesAction action = new TransportGetRolesAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService, new ReservedRolesStore()); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java index 17d36ca46d7..093a88822ab 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java @@ -42,7 +42,7 @@ public class TransportPutRoleActionTests extends ESTestCase { final String roleName = randomFrom(new ArrayList<>(ReservedRolesStore.names())); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutRoleAction action = new TransportPutRoleAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService); @@ -73,7 +73,7 @@ public class TransportPutRoleActionTests extends ESTestCase { final String roleName = randomFrom("admin", "dept_a", "restricted"); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutRoleAction action = new TransportPutRoleAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService); @@ -117,7 +117,7 @@ public class TransportPutRoleActionTests extends ESTestCase { final String roleName = randomFrom("admin", "dept_a", "restricted"); NativeRolesStore rolesStore = mock(NativeRolesStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutRoleAction action = new TransportPutRoleAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), rolesStore, transportService); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportAuthenticateActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportAuthenticateActionTests.java index 5b082d31416..9468fddb579 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportAuthenticateActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportAuthenticateActionTests.java @@ -36,7 +36,7 @@ public class TransportAuthenticateActionTests extends ESTestCase { SecurityContext securityContext = mock(SecurityContext.class); when(securityContext.getUser()).thenReturn(randomFrom(SystemUser.INSTANCE, XPackUser.INSTANCE)); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportAuthenticateAction action = new TransportAuthenticateAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), securityContext); @@ -62,7 +62,7 @@ public class TransportAuthenticateActionTests extends ESTestCase { public void testNullUser() { SecurityContext securityContext = mock(SecurityContext.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportAuthenticateAction action = new TransportAuthenticateAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), securityContext); @@ -90,7 +90,7 @@ public class TransportAuthenticateActionTests extends ESTestCase { SecurityContext securityContext = mock(SecurityContext.class); when(securityContext.getUser()).thenReturn(user); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportAuthenticateAction action = new TransportAuthenticateAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), securityContext); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportChangePasswordActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportChangePasswordActionTests.java index 9ccc1514390..6447e5214cf 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportChangePasswordActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportChangePasswordActionTests.java @@ -48,7 +48,7 @@ public class TransportChangePasswordActionTests extends ESTestCase { AnonymousUser anonymousUser = new AnonymousUser(settings); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportChangePasswordAction action = new TransportChangePasswordAction(settings, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -79,7 +79,7 @@ public class TransportChangePasswordActionTests extends ESTestCase { public void testInternalUsers() { NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportChangePasswordAction action = new TransportChangePasswordAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -123,7 +123,7 @@ public class TransportChangePasswordActionTests extends ESTestCase { } }).when(usersStore).changePassword(eq(request), any(ActionListener.class)); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportChangePasswordAction action = new TransportChangePasswordAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -164,7 +164,7 @@ public class TransportChangePasswordActionTests extends ESTestCase { } }).when(usersStore).changePassword(eq(request), any(ActionListener.class)); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportChangePasswordAction action = new TransportChangePasswordAction(Settings.EMPTY, mock(ThreadPool.class), transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportDeleteUserActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportDeleteUserActionTests.java index a0ae771ea3c..db3a938b99a 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportDeleteUserActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportDeleteUserActionTests.java @@ -45,7 +45,7 @@ public class TransportDeleteUserActionTests extends ESTestCase { Settings settings = Settings.builder().put(AnonymousUser.ROLES_SETTING.getKey(), "superuser").build(); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportDeleteUserAction action = new TransportDeleteUserAction(settings, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -74,7 +74,7 @@ public class TransportDeleteUserActionTests extends ESTestCase { public void testInternalUser() { NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportDeleteUserAction action = new TransportDeleteUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -104,7 +104,7 @@ public class TransportDeleteUserActionTests extends ESTestCase { final User reserved = randomFrom(new ElasticUser(true), new KibanaUser(true)); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportDeleteUserAction action = new TransportDeleteUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -134,7 +134,7 @@ public class TransportDeleteUserActionTests extends ESTestCase { final User user = new User("joe"); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportDeleteUserAction action = new TransportDeleteUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -175,7 +175,7 @@ public class TransportDeleteUserActionTests extends ESTestCase { final User user = new User("joe"); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportDeleteUserAction action = new TransportDeleteUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java index 8206eaca457..83ab7e277bc 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java @@ -5,8 +5,6 @@ */ package org.elasticsearch.xpack.security.action.user; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; @@ -77,7 +75,7 @@ public class TransportGetUsersActionTests extends ESTestCase { AnonymousUser anonymousUser = new AnonymousUser(settings); ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, anonymousUser); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService, reservedRealm); @@ -112,7 +110,7 @@ public class TransportGetUsersActionTests extends ESTestCase { public void testInternalUser() { NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService, mock(ReservedRealm.class)); @@ -153,7 +151,7 @@ public class TransportGetUsersActionTests extends ESTestCase { final List reservedUsers = randomSubsetOf(size, allReservedUsers); final List names = reservedUsers.stream().map(User::principal).collect(Collectors.toList()); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService, reservedRealm); @@ -189,7 +187,7 @@ public class TransportGetUsersActionTests extends ESTestCase { ReservedRealmTests.mockGetAllReservedUserInfo(usersStore, Collections.emptyMap()); ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(settings)); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService, reservedRealm); @@ -236,7 +234,7 @@ public class TransportGetUsersActionTests extends ESTestCase { final String[] storeUsernames = storeUsers.stream().map(User::principal).collect(Collectors.toList()).toArray(Strings.EMPTY_ARRAY); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService, mock(ReservedRealm.class)); @@ -284,7 +282,7 @@ public class TransportGetUsersActionTests extends ESTestCase { final String[] storeUsernames = storeUsers.stream().map(User::principal).collect(Collectors.toList()).toArray(Strings.EMPTY_ARRAY); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService, mock(ReservedRealm.class)); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java index 085eeadcf66..02f43f380da 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java @@ -54,7 +54,7 @@ public class TransportPutUserActionTests extends ESTestCase { final AnonymousUser anonymousUser = new AnonymousUser(settings); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutUserAction action = new TransportPutUserAction(settings, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -84,7 +84,7 @@ public class TransportPutUserActionTests extends ESTestCase { public void testSystemUser() { NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutUserAction action = new TransportPutUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -121,7 +121,7 @@ public class TransportPutUserActionTests extends ESTestCase { reservedRealm.users(userFuture); final User reserved = randomFrom(userFuture.actionGet().toArray(new User[0])); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutUserAction action = new TransportPutUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -152,7 +152,7 @@ public class TransportPutUserActionTests extends ESTestCase { final User user = new User("joe"); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutUserAction action = new TransportPutUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); @@ -198,7 +198,7 @@ public class TransportPutUserActionTests extends ESTestCase { final User user = new User("joe"); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportPutUserAction action = new TransportPutUserAction(Settings.EMPTY, mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore, transportService); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportSetEnabledActionTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportSetEnabledActionTests.java index 4ae82e8e40c..c0aab55b1c5 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportSetEnabledActionTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/action/user/TransportSetEnabledActionTests.java @@ -59,7 +59,7 @@ public class TransportSetEnabledActionTests extends ESTestCase { when(authentication.getRunAsUser()).thenReturn(user); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportSetEnabledAction action = new TransportSetEnabledAction(settings, threadPool, transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -97,7 +97,7 @@ public class TransportSetEnabledActionTests extends ESTestCase { when(authentication.getRunAsUser()).thenReturn(user); NativeUsersStore usersStore = mock(NativeUsersStore.class); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportSetEnabledAction action = new TransportSetEnabledAction(Settings.EMPTY, threadPool, transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -151,7 +151,7 @@ public class TransportSetEnabledActionTests extends ESTestCase { }).when(usersStore) .setEnabled(eq(user.principal()), eq(request.enabled()), eq(request.getRefreshPolicy()), any(ActionListener.class)); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportSetEnabledAction action = new TransportSetEnabledAction(Settings.EMPTY, threadPool, transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -203,7 +203,7 @@ public class TransportSetEnabledActionTests extends ESTestCase { }).when(usersStore) .setEnabled(eq(user.principal()), eq(request.enabled()), eq(request.getRefreshPolicy()), any(ActionListener.class)); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportSetEnabledAction action = new TransportSetEnabledAction(Settings.EMPTY, threadPool, transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore); @@ -243,7 +243,7 @@ public class TransportSetEnabledActionTests extends ESTestCase { request.enabled(randomBoolean()); request.setRefreshPolicy(randomFrom(RefreshPolicy.values())); TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, - null); + x -> null, null); TransportSetEnabledAction action = new TransportSetEnabledAction(Settings.EMPTY, threadPool, transportService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), usersStore);