From 0531dd8b8871773b50182c0b8fed5db710b055d3 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 30 Mar 2016 08:57:32 -0400 Subject: [PATCH] Switch from getRandom to random This is a reaction to https://github.com/elastic/elasticsearch/pull/17394 which handled a long standing TODO in core. Original commit: elastic/x-pack-elasticsearch@76425300a28ce8f82e87d3368cdfae115772f22f --- .../elasticsearch/shield/audit/index/IndexAuditTrailTests.java | 2 +- .../shield/audit/index/RemoteIndexAuditTrailStartingTests.java | 2 +- .../org/elasticsearch/watcher/support/http/HttpClientTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java index 502b0be9e78..46c88beeefc 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java @@ -173,7 +173,7 @@ public class IndexAuditTrailTests extends ShieldIntegTestCase { cluster2 = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), useShield ? getClientWrapper() : Function.identity()); - cluster2.beforeTest(getRandom(), 0.5); + cluster2.beforeTest(random(), 0.5); remoteClient = cluster2.client(); NodesInfoResponse response = remoteClient.admin().cluster().prepareNodesInfo().execute().actionGet(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java index 86ebe3c3568..1f5c0fbefbc 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java @@ -108,7 +108,7 @@ public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase { }; remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), getClientWrapper()); - remoteCluster.beforeTest(getRandom(), 0.5); + remoteCluster.beforeTest(random(), 0.5); } @After diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java index c4af1c0924c..0afaf192257 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java @@ -269,7 +269,7 @@ public class HttpClientTests extends ESTestCase { public void testHttpResponseWithAnyStatusCodeCanReturnBody() throws Exception { int statusCode = randomFrom(200, 201, 400, 401, 403, 404, 405, 409, 413, 429, 500, 503); - String body = RandomStrings.randomAsciiOfLength(getRandom(), 100); + String body = RandomStrings.randomAsciiOfLength(random(), 100); boolean hasBody = usually(); MockResponse mockResponse = new MockResponse().setResponseCode(statusCode); if (hasBody) {