Throw correct exception type, reduce boilerplate in boolean statement
Original commit: elastic/x-pack-elasticsearch@1e33c4d8f2
This commit is contained in:
parent
92637d2eec
commit
238eed2075
|
@ -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);
|
||||
|
|
|
@ -373,9 +373,7 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|||
final List<NodeInfo> 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();
|
||||
|
|
Loading…
Reference in New Issue