From d5db68702cf300203915c4d437886f8ced50cff6 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 20 Dec 2016 21:02:19 -0500 Subject: [PATCH] Adapt to method name change in core This commit adapts to the change of the method name ESTestCase#randomPostivieLong to ESTestCase#randomNonNegativeLong. Original commit: elastic/x-pack-elasticsearch@689429cb54ebbba6bc141b9a69fb5d67fe3bf497 --- .../monitoring/resolver/cluster/ClusterStatsResolverTests.java | 2 +- .../SecurityIndexSearcherWrapperIntegrationTests.java | 2 +- .../accesscontrol/SecurityIndexSearcherWrapperUnitTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/resolver/cluster/ClusterStatsResolverTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/resolver/cluster/ClusterStatsResolverTests.java index f2c2d445fc5..214742b0af0 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/resolver/cluster/ClusterStatsResolverTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/resolver/cluster/ClusterStatsResolverTests.java @@ -115,7 +115,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa buildNewFakeTransportAddress()); return new NodeInfo(Version.CURRENT, org.elasticsearch.Build.CURRENT, new DiscoveryNode("node_0", buildNewFakeTransportAddress(), emptyMap(), emptySet(), Version.CURRENT), Settings.EMPTY, - DummyOsInfo.INSTANCE, new ProcessInfo(randomInt(), randomBoolean(), randomPositiveLong()), JvmInfo.jvmInfo(), + DummyOsInfo.INSTANCE, new ProcessInfo(randomInt(), randomBoolean(), randomNonNegativeLong()), JvmInfo.jvmInfo(), new ThreadPoolInfo(Collections.singletonList(new ThreadPool.Info("test_threadpool", ThreadPool.ThreadPoolType.FIXED, 5))), new TransportInfo(transportAddress, Collections.emptyMap()), new HttpInfo(transportAddress, randomLong()), new PluginsAndModules(Collections.emptyList(), Collections.emptyList()), diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperIntegrationTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperIntegrationTests.java index 00772ea50b2..e5ac91ce533 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperIntegrationTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperIntegrationTests.java @@ -71,7 +71,7 @@ public class SecurityIndexSearcherWrapperIntegrationTests extends ESTestCase { IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(shardId.getIndex(), Settings.EMPTY); Client client = mock(Client.class); when(client.settings()).thenReturn(Settings.EMPTY); - final long nowInMillis = randomPositiveLong(); + final long nowInMillis = randomNonNegativeLong(); QueryShardContext realQueryShardContext = new QueryShardContext(shardId.id(), indexSettings, null, null, mapperService, null, null, xContentRegistry(), client, null, () -> nowInMillis); QueryShardContext queryShardContext = spy(realQueryShardContext); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java index c3eb41298c4..75847ed9efb 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java @@ -814,7 +814,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { public void testFailIfQueryUsesClient() throws Exception { Client client = mock(Client.class); when(client.settings()).thenReturn(Settings.EMPTY); - final long nowInMillis = randomPositiveLong(); + final long nowInMillis = randomNonNegativeLong(); QueryRewriteContext context = new QueryRewriteContext(null, mapperService, scriptService, xContentRegistry(), client, null, () -> nowInMillis); QueryBuilder queryBuilder1 = new TermsQueryBuilder("field", "val1", "val2");