diff --git a/src/test/java/org/opensearch/security/privileges/PrivilegesEvaluatorNewStyleTest.java b/src/test/java/org/opensearch/security/privileges/PrivilegesEvaluatorNewStyleTest.java index d20f35ecbe..1589cfb750 100644 --- a/src/test/java/org/opensearch/security/privileges/PrivilegesEvaluatorNewStyleTest.java +++ b/src/test/java/org/opensearch/security/privileges/PrivilegesEvaluatorNewStyleTest.java @@ -2,7 +2,11 @@ import com.google.common.collect.ImmutableMap; import org.hamcrest.MatcherAssert; -import org.junit.*; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; import org.opensearch.OpenSearchStatusException; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; @@ -34,8 +38,13 @@ import org.opensearch.security.test.helper.rest.GenericRestClient; import org.opensearch.security.test.helper.rest.GenericRestClient.HttpResponse; -import static org.hamcrest.Matchers.*; -import static org.opensearch.security.test.RestMatchers.*; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.equalTo; +import static org.opensearch.security.test.RestMatchers.isForbidden; +import static org.opensearch.security.test.RestMatchers.isOk; +import static org.opensearch.security.test.RestMatchers.json; +import static org.opensearch.security.test.RestMatchers.nodeAt; public class PrivilegesEvaluatorNewStyleTest { diff --git a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/JavaSecurityTestSetup.java b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/JavaSecurityTestSetup.java index 99c61a3e11..dc3fca6ff3 100644 --- a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/JavaSecurityTestSetup.java +++ b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/JavaSecurityTestSetup.java @@ -26,7 +26,11 @@ import java.io.FilePermission; import java.net.SocketPermission; -import java.security.*; +import java.security.AccessControlException; +import java.security.Permission; +import java.security.Permissions; +import java.security.Policy; +import java.security.ProtectionDomain; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; diff --git a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalCluster.java b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalCluster.java index ebba3b17e0..02386e3d4b 100644 --- a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalCluster.java +++ b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalCluster.java @@ -20,14 +20,12 @@ import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.Assert; import org.junit.rules.ExternalResource; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.get.GetRequest; import org.opensearch.action.get.GetResponse; import org.opensearch.action.index.IndexRequest; import org.opensearch.action.index.IndexResponse; -import org.opensearch.action.support.WriteRequest; import org.opensearch.action.support.WriteRequest.RefreshPolicy; import org.opensearch.client.Client; import org.opensearch.common.bytes.BytesReference; diff --git a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalEsCluster.java b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalEsCluster.java index 8cc17a0deb..701bdbdd83 100644 --- a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalEsCluster.java +++ b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/LocalEsCluster.java @@ -61,7 +61,12 @@ import java.net.InetSocketAddress; import java.nio.file.Files; import java.security.KeyStore; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.SortedSet; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; diff --git a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/NestedValueMap.java b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/NestedValueMap.java index 507af0151f..919255bae5 100644 --- a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/NestedValueMap.java +++ b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/NestedValueMap.java @@ -10,7 +10,15 @@ import java.lang.reflect.Array; import java.net.URI; import java.net.URL; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class NestedValueMap extends HashMap { diff --git a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/TestSgConfig.java b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/TestSgConfig.java index 0ec90a6f3b..f4495d52ab 100644 --- a/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/TestSgConfig.java +++ b/src/test/java/org/opensearch/security/test/helper/cluster/newstyle/TestSgConfig.java @@ -38,7 +38,11 @@ import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; public class TestSgConfig { diff --git a/src/test/java/org/opensearch/security/test/helper/rest/GenericSSLConfig.java b/src/test/java/org/opensearch/security/test/helper/rest/GenericSSLConfig.java index a78ca91d35..0b5b42c3a2 100644 --- a/src/test/java/org/opensearch/security/test/helper/rest/GenericSSLConfig.java +++ b/src/test/java/org/opensearch/security/test/helper/rest/GenericSSLConfig.java @@ -10,12 +10,22 @@ import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.ssl.SSLContexts; -import javax.net.ssl.*; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; -import java.security.*; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Collection; diff --git a/src/test/java/org/opensearch/security/test/helper/rest/TrustStore.java b/src/test/java/org/opensearch/security/test/helper/rest/TrustStore.java index fd78390467..01676b2d6b 100644 --- a/src/test/java/org/opensearch/security/test/helper/rest/TrustStore.java +++ b/src/test/java/org/opensearch/security/test/helper/rest/TrustStore.java @@ -2,7 +2,10 @@ import org.opensearch.security.support.PemKeyReader; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; import java.nio.file.Path; import java.security.KeyStore; import java.security.cert.X509Certificate;