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@689429cb54
This commit is contained in:
Jason Tedor 2016-12-20 21:02:19 -05:00
parent 880808c428
commit d5db68702c
3 changed files with 3 additions and 3 deletions

View File

@ -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()),

View File

@ -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);

View File

@ -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");