diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java index a8a5bafda84..219e020b3f4 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java @@ -221,7 +221,7 @@ public class ESNativeRealmMigrateTool extends MultiCommand { parser.skipChildren(); } } else { - throw new Exception("failed to retrieve users, expecting an object but got: " + token); + throw new ElasticsearchException("failed to retrieve users, expecting an object but got: " + token); } } terminal.println("found existing users: " + existingUsers); @@ -296,7 +296,7 @@ public class ESNativeRealmMigrateTool extends MultiCommand { parser.skipChildren(); } } else { - throw new Exception("failed to retrieve roles, expecting an object but got: " + token); + throw new ElasticsearchException("failed to retrieve roles, expecting an object but got: " + token); } } terminal.println("found existing roles: " + existingRoles); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java index 029226fb15c..ca6720069c0 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java @@ -373,9 +373,7 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase { final List nodes = nodeInfos.getNodes(); assertTrue("there is at least one node", nodes.size() > 0); NodeInfo ni = randomFrom(nodes); - if (SecurityNettyHttpServerTransport.SSL_SETTING.get(ni.getSettings())) { - useSSL = true; - } + useSSL = SecurityNettyHttpServerTransport.SSL_SETTING.get(ni.getSettings()); TransportAddress publishAddress = ni.getHttp().address().publishAddress(); assertEquals(1, publishAddress.uniqueAddressTypeId()); InetSocketAddress address = ((InetSocketTransportAddress) publishAddress).address();