diff --git a/build-tools-internal/src/main/resources/checkstyle_ide_fragment.xml b/build-tools-internal/src/main/resources/checkstyle_ide_fragment.xml
index 9441fa9cd77c3..6aeae3712aaf9 100644
--- a/build-tools-internal/src/main/resources/checkstyle_ide_fragment.xml
+++ b/build-tools-internal/src/main/resources/checkstyle_ide_fragment.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/test/framework/src/main/java/org/elasticsearch/test/ActionListenerUtils.java b/test/framework/src/main/java/org/elasticsearch/test/ActionListenerUtils.java
new file mode 100644
index 0000000000000..292e1fbef4a03
--- /dev/null
+++ b/test/framework/src/main/java/org/elasticsearch/test/ActionListenerUtils.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+package org.elasticsearch.test;
+
+import org.elasticsearch.action.ActionListener;
+
+import static org.mockito.Matchers.any;
+
+public abstract class ActionListenerUtils {
+
+ @SuppressWarnings("unchecked")
+ public static ActionListener anyActionListener() {
+ return any(ActionListener.class);
+ }
+}
diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle
index 65f8a0a5d053e..eb832f8f7c237 100644
--- a/x-pack/plugin/security/build.gradle
+++ b/x-pack/plugin/security/build.gradle
@@ -136,10 +136,6 @@ dependencies {
testImplementation('org.apache.directory.mavibot:mavibot:1.0.0-M8')
}
-tasks.withType(JavaCompile).configureEach {
- options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
-}
-
tasks.named("processInternalClusterTestResources").configure {
from(project(xpackModule('core')).file('src/main/config'))
from(project(xpackModule('core')).file('src/test/resources'))
diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlAuthenticateAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlAuthenticateAction.java
index 6f4543cc5ce81..a223b259689b3 100644
--- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlAuthenticateAction.java
+++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlAuthenticateAction.java
@@ -64,6 +64,7 @@ protected void doExecute(Task task, SamlAuthenticateRequest request, ActionListe
return;
}
assert authentication != null : "authentication should never be null at this point";
+ @SuppressWarnings("unchecked")
final Map tokenMeta = (Map) result.getMetadata().get(SamlRealm.CONTEXT_TOKEN_DATA);
tokenService.createOAuth2Tokens(authentication, originatingAuthentication,
tokenMeta, true, ActionListener.wrap(tokenResult -> {
diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionAction.java
index 123ab949127b6..c4402bb85b453 100644
--- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionAction.java
+++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionAction.java
@@ -118,6 +118,7 @@ private void invalidateTokenPair(Tuple tokenPair, ActionListe
private Predicate