From e13a5e695a8cc8a436d860d14738c0a87313a595 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 30 Jan 2016 20:12:15 -0500 Subject: [PATCH] Uppercase ells ('L') in long literals This commit removes all lowercase ells ('l') in long literals because they are often hard to distinguish from the digit representing one ('1'). Closes elastic/elasticsearch#1414 Original commit: elastic/x-pack-elasticsearch@98b38705fb271f475314059195ec80da38e9acec --- .../licensor/LicenseVerificationTests.java | 2 +- .../tests/ScriptConditionSearchTests.java | 4 +- .../messy/tests/ScriptConditionTests.java | 12 ++--- .../tests/TransformIntegrationTests.java | 12 ++--- .../messy/tests/BasicWatcherTests.java | 20 ++++---- .../tests/EmailActionIntegrationTests.java | 2 +- .../messy/tests/EmailAttachmentTests.java | 2 +- .../tests/TimeThrottleIntegrationTests.java | 4 +- .../license/plugin/core/LicensesService.java | 10 ++-- ...nsesConsumerPluginIntegrationTestCase.java | 2 +- .../LicensesPluginIntegrationTests.java | 2 +- .../plugin/LicensesTransportTests.java | 2 +- .../license/plugin/TestUtils.java | 2 +- .../core/LicensesManagerServiceTests.java | 2 +- .../DocumentLevelSecurityTests.java | 34 ++++++------- .../integration/FieldLevelSecurityTests.java | 48 +++++++++---------- ...ldDataCacheWithFieldSubsetReaderTests.java | 12 ++--- .../compare/CompareConditionSearchTests.java | 4 +- .../script/ScriptConditionSearchTests.java | 4 +- .../script/ScriptConditionTests.java | 12 ++--- .../TriggeredWatchStoreLifeCycleTests.java | 2 +- .../execution/TriggeredWatchStoreTests.java | 6 +-- .../input/http/HttpInputIntegrationTests.java | 8 ++-- .../watcher/shield/BasicShieldTests.java | 4 +- .../test/integration/BootStrapTests.java | 12 ++--- .../test/integration/NoMasterNodeTests.java | 6 +-- .../test/integration/WatchMetadataTests.java | 2 +- .../transform/TransformIntegrationTests.java | 12 ++--- .../transport/action/ack/WatchAckTests.java | 6 +-- .../action/stats/SlowWatchStatsTests.java | 4 +- .../action/stats/WatcherStatsTests.java | 2 +- 31 files changed, 128 insertions(+), 128 deletions(-) diff --git a/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/LicenseVerificationTests.java b/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/LicenseVerificationTests.java index 4e081953d6e..8976e579927 100644 --- a/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/LicenseVerificationTests.java +++ b/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/LicenseVerificationTests.java @@ -43,7 +43,7 @@ public class LicenseVerificationTests extends ESTestCase { final License tamperedLicense = License.builder() .fromLicenseSpec(license, license.signature()) - .expiryDate(license.expiryDate() + 10 * 24 * 60 * 60 * 1000l) + .expiryDate(license.expiryDate() + 10 * 24 * 60 * 60 * 1000L) .validate() .build(); diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionSearchTests.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionSearchTests.java index bf2865b73f0..98d55ac7b47 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionSearchTests.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionSearchTests.java @@ -96,8 +96,8 @@ public class ScriptConditionSearchTests extends AbstractWatcherIntegrationTestCa hit.score(1f); hit.shard(new SearchShardTarget("a", new Index("a", "testUUID"), 0)); - InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[]{hit}, 1l, 1f), null, null, null, false, false); - SearchResponse response = new SearchResponse(internalSearchResponse, "", 3, 3, 500l, new ShardSearchFailure[0]); + InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[]{hit}, 1L, 1f), null, null, null, false, false); + SearchResponse response = new SearchResponse(internalSearchResponse, "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_watch_name", new Payload.XContent(response)); assertThat(condition.execute(ctx).met(), is(true)); diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java index b9c6c0c1992..51adfe9d776 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java @@ -61,7 +61,7 @@ public class ScriptConditionTests extends ESTestCase { public void testExecute() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.payload.hits.total > 1").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); assertFalse(condition.execute(ctx).met()); } @@ -70,7 +70,7 @@ public class ScriptConditionTests extends ESTestCase { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); Script script = Script.inline("ctx.payload.hits.total > threshold").lang(Script.DEFAULT_LANG).params(singletonMap("threshold", 1)).build(); ExecutableScriptCondition executable = new ExecutableScriptCondition(new ScriptCondition(script), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); assertFalse(executable.execute(ctx).met()); } @@ -85,7 +85,7 @@ public class ScriptConditionTests extends ESTestCase { ScriptCondition condition = factory.parseCondition("_watch", parser); ExecutableScriptCondition executable = factory.createExecutable(condition); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); assertFalse(executable.execute(ctx).met()); @@ -163,7 +163,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionThrowException() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("assert false").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); ScriptCondition.Result result = condition.execute(ctx); assertThat(result, notNullValue()); @@ -175,7 +175,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionReturnObject() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("return new Object()").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); ScriptCondition.Result result = condition.execute(ctx); assertThat(result, notNullValue()); @@ -187,7 +187,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionAccessCtx() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.trigger.scheduled_time.getMillis() < new Date().time ").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new DateTime(DateTimeZone.UTC), new Payload.XContent(response)); Thread.sleep(10); assertThat(condition.execute(ctx).met(), is(true)); diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIntegrationTests.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIntegrationTests.java index 06de4491b59..761674c932f 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIntegrationTests.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIntegrationTests.java @@ -119,13 +119,13 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas SearchResponse response = client().prepareSearch("output1").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key3").toString(), equalTo("20")); response = client().prepareSearch("output2").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key3").toString(), equalTo("20")); } @@ -168,12 +168,12 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas SearchResponse response = client().prepareSearch("output1").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsString(), containsString("mytestresult")); response = client().prepareSearch("output2").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsString(), containsString("mytestresult")); } @@ -212,13 +212,13 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas SearchResponse response = client().prepareSearch("output1").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key4").toString(), equalTo("30")); response = client().prepareSearch("output2").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key4").toString(), equalTo("30")); } diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/BasicWatcherTests.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/BasicWatcherTests.java index 54aae07cdf0..20293295178 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/BasicWatcherTests.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/BasicWatcherTests.java @@ -88,7 +88,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)) .addAction("_logger", loggingAction("\n\n************\n" + "total hits: {{ctx.payload.hits.total}}\n" + "************\n") @@ -114,7 +114,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l))) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))) .get(); if (timeWarped()) { @@ -145,7 +145,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l))) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))) .get(); assertThat(indexResponse.isCreated(), is(true)); @@ -162,7 +162,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { assertThat(deleteWatchResponse.isFound(), is(true)); refresh(); - assertHitCount(client().prepareSearch(WatchStore.INDEX).setSize(0).get(), 0l); + assertHitCount(client().prepareSearch(WatchStore.INDEX).setSize(0).get(), 0L); // Deleting the same watch for the second time deleteWatchResponse = watcherClient.prepareDeleteWatch("_name").get(); @@ -214,7 +214,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { .addAction("_id", indexAction("idx", "action")); watcherClient().preparePutWatch("_name") - .setSource(source.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l))) + .setSource(source.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))) .get(); if (timeWarped()) { @@ -225,7 +225,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { assertWatchWithMinimumPerformedActionsCount("_name", 0, false); watcherClient().preparePutWatch("_name") - .setSource(source.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 0l))) + .setSource(source.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 0L))) .get(); if (timeWarped()) { @@ -238,7 +238,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { watcherClient().preparePutWatch("_name") .setSource(source .trigger(schedule(Schedules.cron("0/1 * * * * ? 2020"))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 0l))) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 0L))) .get(); if (timeWarped()) { @@ -340,14 +340,14 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest).extractKeys("hits.total")) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l))) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))) .get(); // in this watcher the condition will fail, because max_score isn't extracted, only total: watcherClient.preparePutWatch("_name2") .setSource(watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest).extractKeys("hits.total")) - .condition(compareCondition("ctx.payload.hits.max_score", CompareCondition.Op.GTE, 0l))) + .condition(compareCondition("ctx.payload.hits.max_score", CompareCondition.Op.GTE, 0L))) .get(); if (timeWarped()) { @@ -454,7 +454,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(interval("5s"))) .input(searchInput(request)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GTE, 3l))) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GTE, 3L))) .get(); logger.info("created watch [{}] at [{}]", watchName, SystemClock.INSTANCE.nowUTC()); diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailActionIntegrationTests.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailActionIntegrationTests.java index 208a13ac049..5acf8919b4f 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailActionIntegrationTests.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailActionIntegrationTests.java @@ -94,7 +94,7 @@ public class EmailActionIntegrationTests extends AbstractWatcherIntegrationTestC .setSource(watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .addAction("_email", emailAction(EmailTemplate.builder().from("_from").to("_to") .subject("{{ctx.payload.hits.hits.0._source.field}}")).setAuthentication(USERNAME, PASSWORD.toCharArray()))) .get(); diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailAttachmentTests.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailAttachmentTests.java index 18a1b93a9d0..885fa4c33c6 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailAttachmentTests.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/EmailAttachmentTests.java @@ -194,7 +194,7 @@ public class EmailAttachmentTests extends AbstractWatcherIntegrationTestCase { WatchSourceBuilder watchSourceBuilder = watchBuilder() .trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .addAction("_email", emailAction(emailBuilder).setAuthentication(USERNAME, PASSWORD.toCharArray()) .setAttachments(emailAttachments)); logger.info("TMP WATCHSOURCE {}", watchSourceBuilder.build().getBytes().toUtf8()); diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/TimeThrottleIntegrationTests.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/TimeThrottleIntegrationTests.java index c2e2479ea66..df007830718 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/TimeThrottleIntegrationTests.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/TimeThrottleIntegrationTests.java @@ -75,7 +75,7 @@ public class TimeThrottleIntegrationTests extends AbstractWatcherIntegrationTest .setSource(watchBuilder() .trigger(schedule(interval("5s"))) .input(searchInput(matchAllRequest().indices("events"))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .transform(searchTransform(matchAllRequest().indices("events"))) .addAction("_id", indexAction("actions", "action")) .defaultThrottlePeriod(TimeValue.timeValueSeconds(30))) @@ -149,7 +149,7 @@ public class TimeThrottleIntegrationTests extends AbstractWatcherIntegrationTest .setSource(watchBuilder() .trigger(schedule(interval("1s"))) .input(searchInput(matchAllRequest().indices("events"))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .transform(searchTransform(matchAllRequest().indices("events"))) .addAction("_id", indexAction("actions", "action"))) .get(); diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java index 8a19a3c1071..7624f801edc 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java @@ -643,7 +643,7 @@ public class LicensesService extends AbstractLifecycleComponent @Override public boolean matches(long expirationDate, long now) { long expiryDuration = expirationDate - now; - if (expiryDuration > 0l) { + if (expiryDuration > 0L) { if (expiryDuration <= max.getMillis()) { return expiryDuration >= min.getMillis(); } @@ -673,7 +673,7 @@ public class LicensesService extends AbstractLifecycleComponent @Override public boolean matches(long expirationDate, long now) { long postExpiryDuration = now - expirationDate; - if (postExpiryDuration > 0l) { + if (postExpiryDuration > 0L) { if (postExpiryDuration <= max.getMillis()) { return postExpiryDuration >= min.getMillis(); } @@ -684,12 +684,12 @@ public class LicensesService extends AbstractLifecycleComponent @Override public TimeValue delay(long expiryDuration) { final long delay; - if (expiryDuration >= 0l) { + if (expiryDuration >= 0L) { delay = expiryDuration + min.getMillis(); } else { - delay = (-1l * expiryDuration) - min.getMillis(); + delay = (-1L * expiryDuration) - min.getMillis(); } - if (delay > 0l) { + if (delay > 0L) { return TimeValue.timeValueMillis(delay); } else { return null; diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java index d4be42a94e3..7b45766765b 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java @@ -126,7 +126,7 @@ public abstract class AbstractLicensesConsumerPluginIntegrationTestCase extends assertLicenseeState(consumerPlugin.id(), LicenseState.ENABLED); logger.info(" --> sleep for rest of trailLicense duration"); - Thread.sleep(trialLicenseDurationInSeconds * 1000l); + Thread.sleep(trialLicenseDurationInSeconds * 1000L); logger.info(" --> check consumer is still enabled [signed license]"); // consumer plugin should notify onEnabled on all data nodes (signed license) diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java index d7b809a4d6e..cb7e616086c 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java @@ -121,7 +121,7 @@ public class LicensesPluginIntegrationTests extends AbstractLicensesIntegrationT assertLicenseeState(getCurrentFeatureName(), LicenseState.ENABLED); logger.info(" --> sleep for rest of trailLicense duration"); - Thread.sleep(trialLicenseDurationInSeconds * 1000l); + Thread.sleep(trialLicenseDurationInSeconds * 1000L); logger.info(" --> check consumer is still enabled [signed license]"); // consumer plugin should notify onEnabled on all data nodes (signed license) diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java index 9b8ea3294c3..da00e9d5864 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java @@ -78,7 +78,7 @@ public class LicensesTransportTests extends AbstractLicensesIntegrationTestCase // modify content of signed license License tamperedLicense = License.builder() .fromLicenseSpec(signedLicense, signedLicense.signature()) - .expiryDate(signedLicense.expiryDate() + 10 * 24 * 60 * 60 * 1000l) + .expiryDate(signedLicense.expiryDate() + 10 * 24 * 60 * 60 * 1000L) .validate() .build(); diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java index c1f2b612841..32f937b0351 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java @@ -117,7 +117,7 @@ public class TestUtils { } public static License generateSignedLicense(String type, long issueDate, TimeValue expiryDuration) throws Exception { - long issue = (issueDate != -1l) ? issueDate : System.currentTimeMillis(); + long issue = (issueDate != -1L) ? issueDate : System.currentTimeMillis(); int version = randomIntBetween(License.VERSION_START, License.VERSION_CURRENT); final String licenseType; if (version < License.VERSION_NO_FEATURE_TYPE) { diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesManagerServiceTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesManagerServiceTests.java index 993b2f89d4a..9a419aa56e3 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesManagerServiceTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesManagerServiceTests.java @@ -79,7 +79,7 @@ public class LicensesManagerServiceTests extends ESSingleNodeTestCase { // modify content of signed license License tamperedLicense = License.builder() .fromLicenseSpec(signedLicense, signedLicense.signature()) - .expiryDate(signedLicense.expiryDate() + 10 * 24 * 60 * 60 * 1000l) + .expiryDate(signedLicense.expiryDate() + 10 * 24 * 60 * 60 * 1000L) .validate() .build(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java index 40681f9e1f9..06a7a103618 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java @@ -306,10 +306,10 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { assertSearchHits(response, "1", "2"); Global globalAgg = response.getAggregations().get("global"); - assertThat(globalAgg.getDocCount(), equalTo(2l)); + assertThat(globalAgg.getDocCount(), equalTo(2L)); Terms termsAgg = globalAgg.getAggregations().get("field2"); assertThat(termsAgg.getBuckets().get(0).getKeyAsString(), equalTo("value2")); - assertThat(termsAgg.getBuckets().get(0).getDocCount(), equalTo(1l)); + assertThat(termsAgg.getBuckets().get(0).getDocCount(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user1", USERS_PASSWD))) .prepareSearch("test") @@ -319,7 +319,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { assertSearchHits(response, "1"); globalAgg = response.getAggregations().get("global"); - assertThat(globalAgg.getDocCount(), equalTo(1l)); + assertThat(globalAgg.getDocCount(), equalTo(1L)); termsAgg = globalAgg.getAggregations().get("field2"); assertThat(termsAgg.getBuckets().size(), equalTo(0)); } @@ -346,10 +346,10 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { assertSearchHits(response, "1"); Children children = response.getAggregations().get("children"); - assertThat(children.getDocCount(), equalTo(1l)); + assertThat(children.getDocCount(), equalTo(1L)); Terms termsAgg = children.getAggregations().get("field3"); assertThat(termsAgg.getBuckets().get(0).getKeyAsString(), equalTo("value3")); - assertThat(termsAgg.getBuckets().get(0).getDocCount(), equalTo(1l)); + assertThat(termsAgg.getBuckets().get(0).getDocCount(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user1", USERS_PASSWD))) .prepareSearch("test") @@ -361,7 +361,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { assertSearchHits(response, "1"); children = response.getAggregations().get("children"); - assertThat(children.getDocCount(), equalTo(0l)); + assertThat(children.getDocCount(), equalTo(0L)); termsAgg = children.getAggregations().get("field3"); assertThat(termsAgg.getBuckets().size(), equalTo(0)); } @@ -381,15 +381,15 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { SearchResponse searchResponse = client().prepareSearch("test") .setQuery(hasChildQuery("child", matchAllQuery())) .get(); - assertHitCount(searchResponse, 1l); - assertThat(searchResponse.getHits().totalHits(), equalTo(1l)); + assertHitCount(searchResponse, 1L); + assertThat(searchResponse.getHits().totalHits(), equalTo(1L)); assertThat(searchResponse.getHits().getAt(0).id(), equalTo("p1")); searchResponse = client().prepareSearch("test") .setQuery(hasParentQuery("parent", matchAllQuery())) .addSort("_id", SortOrder.ASC) .get(); - assertHitCount(searchResponse, 2l); + assertHitCount(searchResponse, 2L); assertThat(searchResponse.getHits().getAt(0).id(), equalTo("c1")); assertThat(searchResponse.getHits().getAt(1).id(), equalTo("c2")); @@ -398,25 +398,25 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { .prepareSearch("test") .setQuery(hasChildQuery("child", matchAllQuery())) .get(); - assertHitCount(searchResponse, 0l); + assertHitCount(searchResponse, 0L); searchResponse = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) .prepareSearch("test") .setQuery(hasChildQuery("child", matchAllQuery())) .get(); - assertHitCount(searchResponse, 0l); + assertHitCount(searchResponse, 0L); searchResponse = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user1", USERS_PASSWD))) .prepareSearch("test") .setQuery(hasParentQuery("parent", matchAllQuery())) .get(); - assertHitCount(searchResponse, 0l); + assertHitCount(searchResponse, 0L); searchResponse = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) .prepareSearch("test") .setQuery(hasParentQuery("parent", matchAllQuery())) .get(); - assertHitCount(searchResponse, 0l); + assertHitCount(searchResponse, 0L); } public void testPercolateApi() { @@ -434,7 +434,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { .setDocumentType("type") .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(1l)); + assertThat(response.getCount(), equalTo(1L)); assertThat(response.getMatches()[0].getId().string(), equalTo("1")); // Percolator with a query on a document that the current user can see. Percolator will have one query to evaluate, so there is a match: @@ -444,7 +444,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { .setPercolateQuery(termQuery("field1", "value1")) .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(1l)); + assertThat(response.getCount(), equalTo(1L)); assertThat(response.getMatches()[0].getId().string(), equalTo("1")); // Percolator with a query on a document that the current user can't see. Percolator will not have queries to evaluate, so there is no match: @@ -454,7 +454,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { .setPercolateQuery(termQuery("field1", "value1")) .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(0l)); + assertThat(response.getCount(), equalTo(0L)); assertAcked(client().admin().indices().prepareClose("test")); assertAcked(client().admin().indices().prepareOpen("test")); @@ -466,7 +466,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase { .setDocumentType("type") .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(1l)); + assertThat(response.getCount(), equalTo(1L)); assertThat(response.getMatches()[0].getId().string(), equalTo("1")); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java index 8e8c1424755..c3233b29797 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java @@ -336,7 +336,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setFields("field1", "field2") .get(); assertThat(response.getAllFieldStats().size(), equalTo(1)); - assertThat(response.getAllFieldStats().get("field1").getDocCount(), equalTo(1l)); + assertThat(response.getAllFieldStats().get("field1").getDocCount(), equalTo(1L)); // user2 is granted access to field2 only: response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) @@ -344,7 +344,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setFields("field1", "field2") .get(); assertThat(response.getAllFieldStats().size(), equalTo(1)); - assertThat(response.getAllFieldStats().get("field2").getDocCount(), equalTo(1l)); + assertThat(response.getAllFieldStats().get("field2").getDocCount(), equalTo(1L)); // user3 is granted access to field1 and field2: response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user3", USERS_PASSWD))) @@ -352,8 +352,8 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setFields("field1", "field2") .get(); assertThat(response.getAllFieldStats().size(), equalTo(2)); - assertThat(response.getAllFieldStats().get("field1").getDocCount(), equalTo(1l)); - assertThat(response.getAllFieldStats().get("field2").getDocCount(), equalTo(1l)); + assertThat(response.getAllFieldStats().get("field1").getDocCount(), equalTo(1L)); + assertThat(response.getAllFieldStats().get("field2").getDocCount(), equalTo(1L)); // user4 is granted access to no fields: response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user4", USERS_PASSWD))) @@ -368,8 +368,8 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setFields("field1", "field2") .get(); assertThat(response.getAllFieldStats().size(), equalTo(2)); - assertThat(response.getAllFieldStats().get("field1").getDocCount(), equalTo(1l)); - assertThat(response.getAllFieldStats().get("field2").getDocCount(), equalTo(1l)); + assertThat(response.getAllFieldStats().get("field1").getDocCount(), equalTo(1L)); + assertThat(response.getAllFieldStats().get("field2").getDocCount(), equalTo(1L)); } public void testQueryCache() throws Exception { @@ -541,7 +541,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .prepareSearch("test") .addSort("field1", SortOrder.ASC) .get(); - assertThat((Long) response.getHits().getAt(0).sortValues()[0], equalTo(1l)); + assertThat((Long) response.getHits().getAt(0).sortValues()[0], equalTo(1L)); // user2 is not granted to use field1, so the default missing sort value is included response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) @@ -562,7 +562,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .prepareSearch("test") .addSort("field2", SortOrder.ASC) .get(); - assertThat((Long) response.getHits().getAt(0).sortValues()[0], equalTo(2l)); + assertThat((Long) response.getHits().getAt(0).sortValues()[0], equalTo(2L)); } public void testAggs() throws Exception { @@ -578,7 +578,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .prepareSearch("test") .addAggregation(AggregationBuilders.terms("_name").field("field1")) .get(); - assertThat(((Terms) response.getAggregations().get("_name")).getBucketByKey("value1").getDocCount(), equalTo(1l)); + assertThat(((Terms) response.getAggregations().get("_name")).getBucketByKey("value1").getDocCount(), equalTo(1L)); // user2 is not authorized to use field1, so no buckets are include for a term agg on field1 response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) @@ -599,7 +599,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .prepareSearch("test") .addAggregation(AggregationBuilders.terms("_name").field("field2")) .get(); - assertThat(((Terms) response.getAggregations().get("_name")).getBucketByKey("value2").getDocCount(), equalTo(1l)); + assertThat(((Terms) response.getAggregations().get("_name")).getBucketByKey("value2").getDocCount(), equalTo(1L)); } public void testTVApi() throws Exception { @@ -617,7 +617,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .get(); assertThat(response.isExists(), is(true)); assertThat(response.getFields().size(), equalTo(1)); - assertThat(response.getFields().terms("field1").size(), equalTo(1l)); + assertThat(response.getFields().terms("field1").size(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) .prepareTermVectors("test", "type1", "1") @@ -625,7 +625,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .get(); assertThat(response.isExists(), is(true)); assertThat(response.getFields().size(), equalTo(1)); - assertThat(response.getFields().terms("field2").size(), equalTo(1l)); + assertThat(response.getFields().terms("field2").size(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user3", USERS_PASSWD))) .prepareTermVectors("test", "type1", "1") @@ -633,8 +633,8 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .get(); assertThat(response.isExists(), is(true)); assertThat(response.getFields().size(), equalTo(2)); - assertThat(response.getFields().terms("field1").size(), equalTo(1l)); - assertThat(response.getFields().terms("field2").size(), equalTo(1l)); + assertThat(response.getFields().terms("field1").size(), equalTo(1L)); + assertThat(response.getFields().terms("field2").size(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user4", USERS_PASSWD))) .prepareTermVectors("test", "type1", "1") @@ -660,7 +660,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { assertThat(response.getResponses().length, equalTo(1)); assertThat(response.getResponses()[0].getResponse().isExists(), is(true)); assertThat(response.getResponses()[0].getResponse().getFields().size(), equalTo(1)); - assertThat(response.getResponses()[0].getResponse().getFields().terms("field1").size(), equalTo(1l)); + assertThat(response.getResponses()[0].getResponse().getFields().terms("field1").size(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) .prepareMultiTermVectors() @@ -669,7 +669,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { assertThat(response.getResponses().length, equalTo(1)); assertThat(response.getResponses()[0].getResponse().isExists(), is(true)); assertThat(response.getResponses()[0].getResponse().getFields().size(), equalTo(1)); - assertThat(response.getResponses()[0].getResponse().getFields().terms("field2").size(), equalTo(1l)); + assertThat(response.getResponses()[0].getResponse().getFields().terms("field2").size(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user3", USERS_PASSWD))) .prepareMultiTermVectors() @@ -678,8 +678,8 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { assertThat(response.getResponses().length, equalTo(1)); assertThat(response.getResponses()[0].getResponse().isExists(), is(true)); assertThat(response.getResponses()[0].getResponse().getFields().size(), equalTo(2)); - assertThat(response.getResponses()[0].getResponse().getFields().terms("field1").size(), equalTo(1l)); - assertThat(response.getResponses()[0].getResponse().getFields().terms("field2").size(), equalTo(1l)); + assertThat(response.getResponses()[0].getResponse().getFields().terms("field1").size(), equalTo(1L)); + assertThat(response.getResponses()[0].getResponse().getFields().terms("field2").size(), equalTo(1L)); response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user4", USERS_PASSWD))) .prepareMultiTermVectors() @@ -705,7 +705,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setDocumentType("type") .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(1l)); + assertThat(response.getCount(), equalTo(1L)); assertThat(response.getMatches()[0].getId().string(), equalTo("1")); // Percolator with a query on a field that the current user can't see. Percolator will not have queries to evaluate, so there is no match: @@ -715,7 +715,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setPercolateQuery(termQuery("field1", "value1")) .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(0l)); + assertThat(response.getCount(), equalTo(0L)); assertAcked(client().admin().indices().prepareClose("test")); assertAcked(client().admin().indices().prepareOpen("test")); @@ -727,7 +727,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .setDocumentType("type") .setPercolateDoc(new PercolateSourceBuilder.DocBuilder().setDoc("{}")) .get(); - assertThat(response.getCount(), equalTo(1l)); + assertThat(response.getCount(), equalTo(1L)); assertThat(response.getMatches()[0].getId().string(), equalTo("1")); } @@ -747,15 +747,15 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase { .prepareSearch("test") .setQuery(hasChildQuery("child", termQuery("field1", "yellow"))) .get(); - assertHitCount(searchResponse, 1l); - assertThat(searchResponse.getHits().totalHits(), equalTo(1l)); + assertHitCount(searchResponse, 1L); + assertThat(searchResponse.getHits().totalHits(), equalTo(1L)); assertThat(searchResponse.getHits().getAt(0).id(), equalTo("p1")); searchResponse = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD))) .prepareSearch("test") .setQuery(hasChildQuery("child", termQuery("field1", "yellow"))) .get(); - assertHitCount(searchResponse, 0l); + assertHitCount(searchResponse, 0L); } public void testUpdateApiIsBlocked() throws Exception { diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authz/accesscontrol/FieldDataCacheWithFieldSubsetReaderTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authz/accesscontrol/FieldDataCacheWithFieldSubsetReaderTests.java index 0e15cb00803..e0137f5e540 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authz/accesscontrol/FieldDataCacheWithFieldSubsetReaderTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authz/accesscontrol/FieldDataCacheWithFieldSubsetReaderTests.java @@ -99,20 +99,20 @@ public class FieldDataCacheWithFieldSubsetReaderTests extends ESTestCase { DirectoryReader ir = FieldSubsetReader.wrap(this.ir, Collections.emptySet()); global = sortedSetDVOrdinalsIndexFieldData.loadGlobal(ir); atomic = global.load(ir.leaves().get(0)); - assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0l)); + assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0L)); assertThat(indexFieldDataCache.topLevelBuilds, equalTo(1)); } public void testSortedSetDVOrdinalsIndexFieldData_segment() throws Exception { for (LeafReaderContext context : ir.leaves()) { AtomicOrdinalsFieldData atomic = sortedSetDVOrdinalsIndexFieldData.load(context); - assertThat(atomic.getOrdinalsValues().getValueCount(), greaterThanOrEqualTo(1l)); + assertThat(atomic.getOrdinalsValues().getValueCount(), greaterThanOrEqualTo(1L)); } DirectoryReader ir = FieldSubsetReader.wrap(this.ir, Collections.emptySet()); for (LeafReaderContext context : ir.leaves()) { AtomicOrdinalsFieldData atomic = sortedSetDVOrdinalsIndexFieldData.load(context); - assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0l)); + assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0L)); } // dv based field data doesn't use index field data cache, so in the end noting should have been added assertThat(indexFieldDataCache.leafLevelBuilds, equalTo(0)); @@ -128,7 +128,7 @@ public class FieldDataCacheWithFieldSubsetReaderTests extends ESTestCase { DirectoryReader ir = FieldSubsetReader.wrap(this.ir, Collections.emptySet()); global = pagedBytesIndexFieldData.loadGlobal(ir); atomic = global.load(ir.leaves().get(0)); - assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0l)); + assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0L)); assertThat(indexFieldDataCache.topLevelBuilds, equalTo(1)); } @@ -136,14 +136,14 @@ public class FieldDataCacheWithFieldSubsetReaderTests extends ESTestCase { assertThat(indexFieldDataCache.leafLevelBuilds, equalTo(0)); for (LeafReaderContext context : ir.leaves()) { AtomicOrdinalsFieldData atomic = pagedBytesIndexFieldData.load(context); - assertThat(atomic.getOrdinalsValues().getValueCount(), greaterThanOrEqualTo(1l)); + assertThat(atomic.getOrdinalsValues().getValueCount(), greaterThanOrEqualTo(1L)); } assertThat(indexFieldDataCache.leafLevelBuilds, equalTo(ir.leaves().size())); DirectoryReader ir = FieldSubsetReader.wrap(this.ir, Collections.emptySet()); for (LeafReaderContext context : ir.leaves()) { AtomicOrdinalsFieldData atomic = pagedBytesIndexFieldData.load(context); - assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0l)); + assertThat(atomic.getOrdinalsValues().getValueCount(), equalTo(0L)); } assertThat(indexFieldDataCache.leafLevelBuilds, equalTo(ir.leaves().size())); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionSearchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionSearchTests.java index 12acc32f3d9..5db659d89b8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionSearchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionSearchTests.java @@ -84,8 +84,8 @@ public class CompareConditionSearchTests extends AbstractWatcherIntegrationTestC hit.score(1f); hit.shard(new SearchShardTarget("a", new Index("a", "indexUUID"), 0)); - InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[]{hit}, 1l, 1f), null, null, null, false, false); - SearchResponse response = new SearchResponse(internalSearchResponse, "", 3, 3, 500l, new ShardSearchFailure[0]); + InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[]{hit}, 1L, 1f), null, null, null, false, false); + SearchResponse response = new SearchResponse(internalSearchResponse, "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_watch_name", new Payload.XContent(response)); assertThat(condition.execute(ctx).met(), is(true)); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionSearchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionSearchTests.java index 9a7bcf69fe6..a5607d33630 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionSearchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionSearchTests.java @@ -86,8 +86,8 @@ public class ScriptConditionSearchTests extends AbstractWatcherIntegrationTestCa hit.score(1f); hit.shard(new SearchShardTarget("a", new Index("a", "testUUID"), 0)); - InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[]{hit}, 1l, 1f), null, null, null, false, false); - SearchResponse response = new SearchResponse(internalSearchResponse, "", 3, 3, 500l, new ShardSearchFailure[0]); + InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[]{hit}, 1L, 1f), null, null, null, false, false); + SearchResponse response = new SearchResponse(internalSearchResponse, "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_watch_name", new Payload.XContent(response)); assertThat(condition.execute(ctx).met(), is(true)); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java index 6e3bd04adec..fe4362a2e82 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java @@ -60,7 +60,7 @@ public class ScriptConditionTests extends ESTestCase { public void testExecute() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.payload.hits.total > 1").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); assertFalse(condition.execute(ctx).met()); } @@ -69,7 +69,7 @@ public class ScriptConditionTests extends ESTestCase { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); Script script = Script.inline("ctx.payload.hits.total > threshold").lang(Script.DEFAULT_LANG).params(singletonMap("threshold", 1)).build(); ExecutableScriptCondition executable = new ExecutableScriptCondition(new ScriptCondition(script), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); assertFalse(executable.execute(ctx).met()); } @@ -84,7 +84,7 @@ public class ScriptConditionTests extends ESTestCase { ScriptCondition condition = factory.parseCondition("_watch", parser); ExecutableScriptCondition executable = factory.createExecutable(condition); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); assertFalse(executable.execute(ctx).met()); @@ -162,7 +162,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionThrowException() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("assert false").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); ScriptCondition.Result result = condition.execute(ctx); assertThat(result, notNullValue()); @@ -174,7 +174,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionReturnObject() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("return new Object()").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new Payload.XContent(response)); ScriptCondition.Result result = condition.execute(ctx); assertThat(result, notNullValue()); @@ -186,7 +186,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionAccessCtx() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.trigger.scheduled_time.getMillis() < System.currentTimeMillis() ").build()), logger, scriptService); - SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); + SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500L, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new DateTime(DateTimeZone.UTC), new Payload.XContent(response)); Thread.sleep(10); assertThat(condition.execute(ctx).met(), is(true)); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreLifeCycleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreLifeCycleTests.java index 1853a2f25e5..4aeb81a6c61 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreLifeCycleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreLifeCycleTests.java @@ -56,7 +56,7 @@ public class TriggeredWatchStoreLifeCycleTests extends AbstractWatcherIntegratio assertThat(loadedTriggeredWatches.contains(triggeredWatch), is(true)); triggeredWatchStore.delete(triggeredWatch.id()); GetResponse getResponse = client().prepareGet(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value()) - .setVersion(2l) + .setVersion(2L) .get(); assertThat(getResponse.isExists(), equalTo(false)); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java index c67b238e491..31a65a4e822 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java @@ -269,7 +269,7 @@ public class TriggeredWatchStoreTests extends ESTestCase { when(searchResponse1.getSuccessfulShards()).thenReturn(1); when(searchResponse1.getTotalShards()).thenReturn(1); InternalSearchHit hit = new InternalSearchHit(0, "_id", new Text("_type"), null); - hit.version(1l); + hit.version(1L); hit.shard(new SearchShardTarget("_node_id", index, 0)); hit.sourceRef(new BytesArray("{}")); InternalSearchHits hits = new InternalSearchHits(new InternalSearchHit[]{hit}, 1, 1.0f); @@ -279,7 +279,7 @@ public class TriggeredWatchStoreTests extends ESTestCase { // First return a scroll response with a single hit and then with no hits hit = new InternalSearchHit(0, "_id", new Text("_type"), null); - hit.version(1l); + hit.version(1L); hit.shard(new SearchShardTarget("_node_id", index, 0)); hit.sourceRef(new BytesArray("{}")); hits = new InternalSearchHits(new InternalSearchHit[]{hit}, 1, 1.0f); @@ -289,7 +289,7 @@ public class TriggeredWatchStoreTests extends ESTestCase { TriggeredWatch triggeredWatch = mock(TriggeredWatch.class); - when(parser.parse(eq("_id"), eq(1l), any(BytesReference.class))).thenReturn(triggeredWatch); + when(parser.parse(eq("_id"), eq(1L), any(BytesReference.class))).thenReturn(triggeredWatch); when(clientProxy.clearScroll(anyString())).thenReturn(new ClearScrollResponse(true, 1)); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java index 5d8fdb94b95..32892090ea5 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java @@ -60,7 +60,7 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas .path("/index/_search") .body(jsonBuilder().startObject().field("size", 1).endObject()) .auth(shieldEnabled() ? new BasicAuth("test", "changeme".toCharArray()) : null))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)) .addAction("_id", loggingAction("watch [{{ctx.watch_id}}] matched"))) .get(); @@ -79,7 +79,7 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas .input(httpInput(HttpRequestTemplate.builder(address.getHostString(), address.getPort()) .path("/_cluster/stats") .auth(shieldEnabled() ? new BasicAuth("test", "changeme".toCharArray()) : null))) - .condition(compareCondition("ctx.payload.nodes.count.total", CompareCondition.Op.GTE, 1l)) + .condition(compareCondition("ctx.payload.nodes.count.total", CompareCondition.Op.GTE, 1L)) .addAction("_id", loggingAction("watch [{{ctx.watch_id}}] matched"))) .get(); @@ -114,7 +114,7 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas .setSource(watchBuilder() .trigger(schedule(interval(10, IntervalSchedule.Interval.Unit.SECONDS))) .input(httpInput(requestBuilder).extractKeys("hits.total")) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l))) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))) .get(); // in this watcher the condition will fail, because max_score isn't extracted, only total: @@ -122,7 +122,7 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas .setSource(watchBuilder() .trigger(schedule(interval(10, IntervalSchedule.Interval.Unit.SECONDS))) .input(httpInput(requestBuilder).extractKeys("hits.total")) - .condition(compareCondition("ctx.payload.hits.max_score", CompareCondition.Op.GTE, 0l))) + .condition(compareCondition("ctx.payload.hits.max_score", CompareCondition.Op.GTE, 0L))) .get(); if (timeWarped()) { diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java index 9fac6f061f6..3e9ff83aa2c 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java @@ -129,7 +129,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase { .preparePutWatch("_id") .setSource(watchBuilder().trigger(schedule(interval(5, IntervalSchedule.Interval.Unit.SECONDS)))) .get(); - assertThat(putWatchResponse.getVersion(), equalTo(1l)); + assertThat(putWatchResponse.getVersion(), equalTo(1L)); ExecuteWatchResponse executeWatchResponse = watcherClient().filterWithHeader(Collections.singletonMap("Authorization", token)) .prepareExecuteWatch("_id") .setTriggerEvent(triggerEvent) @@ -137,7 +137,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase { DeleteWatchResponse deleteWatchResponse = watcherClient().filterWithHeader(Collections.singletonMap("Authorization", token)) .prepareDeleteWatch("_id") .get(); - assertThat(deleteWatchResponse.getVersion(), equalTo(2l)); + assertThat(deleteWatchResponse.getVersion(), equalTo(2L)); assertThat(deleteWatchResponse.isFound(), is(true)); // stats and get watch are also allowed by role monitor: diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BootStrapTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BootStrapTests.java index 927bc507321..2bc05422bae 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BootStrapTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BootStrapTests.java @@ -104,7 +104,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { WatcherStatsResponse response = watcherClient().prepareWatcherStats().get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); // Only the valid watch should been loaded - assertThat(response.getWatchesCount(), equalTo(1l)); + assertThat(response.getWatchesCount(), equalTo(1L)); assertThat(watcherClient().prepareGetWatch("_id0").get().getId(), Matchers.equalTo("_id0")); } @@ -184,7 +184,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { WatcherStatsResponse response = watcherClient().prepareWatcherStats().get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); - assertThat(response.getWatchesCount(), equalTo(1l)); + assertThat(response.getWatchesCount(), equalTo(1L)); } public void testDeletedWhileQueued() throws Exception { @@ -221,7 +221,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(cron("0 0/5 * * * ? 2050"))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)) .buildAsBytes(XContentType.JSON) ) .setConsistencyLevel(WriteConsistencyLevel.ALL) @@ -282,7 +282,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { // that numRecords watch records have been processed as part of starting up. WatcherStatsResponse response = watcherClient().prepareWatcherStats().get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); - assertThat(response.getThreadPoolQueueSize(), equalTo(0l)); + assertThat(response.getThreadPoolQueueSize(), equalTo(0L)); // but even then since the execution of the watch record is async it may take a little bit before // the actual documents are in the output index @@ -333,7 +333,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { // that numRecords watch records have been processed as part of starting up. WatcherStatsResponse response = watcherClient().prepareWatcherStats().get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); - assertThat(response.getThreadPoolQueueSize(), equalTo(0l)); + assertThat(response.getThreadPoolQueueSize(), equalTo(0L)); // but even then since the execution of the watch record is async it may take a little bit before // the actual documents are in the output index @@ -390,7 +390,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { // that numRecords watch records have been processed as part of starting up. WatcherStatsResponse response = watcherClient().prepareWatcherStats().get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); - assertThat(response.getThreadPoolQueueSize(), equalTo(0l)); + assertThat(response.getThreadPoolQueueSize(), equalTo(0L)); // but even then since the execution of the watch record is async it may take a little bit before // the actual documents are in the output index diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java index c2033af6586..ba65396e05b 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java @@ -94,7 +94,7 @@ public class NoMasterNodeTests extends AbstractWatcherIntegrationTestCase { WatchSourceBuilder watchSource = watchBuilder() .trigger(schedule(cron("0/5 * * * * ? *"))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)); + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)); // we first need to make sure the license is enabled, otherwise all APIs will be blocked ensureLicenseEnabled(); @@ -203,7 +203,7 @@ public class NoMasterNodeTests extends AbstractWatcherIntegrationTestCase { WatchSourceBuilder watchSource = watchBuilder() .trigger(schedule(cron("0/5 * * * * ? *"))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)); + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)); watcherClient().preparePutWatch(watchName).setSource(watchSource).get(); } ensureGreen(); @@ -254,7 +254,7 @@ public class NoMasterNodeTests extends AbstractWatcherIntegrationTestCase { assertThat(watcherService.state(), is(WatcherState.STOPPED)); } for (ExecutionService executionService : internalCluster().getInstances(ExecutionService.class)) { - assertThat(executionService.executionThreadPoolQueueSize(), equalTo(0l)); + assertThat(executionService.executionThreadPoolQueueSize(), equalTo(0L)); } } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java index 13b0323ddd1..2fb36bcf883 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java @@ -58,7 +58,7 @@ public class WatchMetadataTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(cron("0/5 * * * * ? *"))) .input(searchInput(WatcherTestUtils.newInputSearchRequest("my-index").source(searchSource().query(matchAllQuery())))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)) .metadata(metadata)) .get(); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transform/TransformIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transform/TransformIntegrationTests.java index f6be9b031da..68bd7093109 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transform/TransformIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transform/TransformIntegrationTests.java @@ -108,13 +108,13 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas SearchResponse response = client().prepareSearch("output1").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key3").toString(), equalTo("20")); response = client().prepareSearch("output2").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key3").toString(), equalTo("20")); } @@ -157,12 +157,12 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas SearchResponse response = client().prepareSearch("output1").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsString(), containsString("mytestresult")); response = client().prepareSearch("output2").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsString(), containsString("mytestresult")); } @@ -201,13 +201,13 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas SearchResponse response = client().prepareSearch("output1").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key4").toString(), equalTo("30")); response = client().prepareSearch("output2").get(); assertNoFailures(response); - assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1l)); + assertThat(response.getHits().getTotalHits(), greaterThanOrEqualTo(1L)); assertThat(response.getHits().getAt(0).sourceAsMap().size(), equalTo(1)); assertThat(response.getHits().getAt(0).sourceAsMap().get("key4").toString(), equalTo("30")); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/ack/WatchAckTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/ack/WatchAckTests.java index a1f9a1a7a2c..6dd1ff4dfee 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/ack/WatchAckTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/ack/WatchAckTests.java @@ -73,7 +73,7 @@ public class WatchAckTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(cron("0/5 * * * * ? *"))) .input(searchInput(matchAllRequest().indices("events"))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .transform(searchTransform(matchAllRequest().indices("events"))) .addAction("_a1", indexAction("actions", "action1")) .addAction("_a2", indexAction("actions", "action2")) @@ -145,7 +145,7 @@ public class WatchAckTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(cron("0/5 * * * * ? *"))) .input(searchInput(matchAllRequest().indices("events"))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .transform(searchTransform(matchAllRequest().indices("events"))) .addAction("_a1", indexAction("actions", "action1")) .addAction("_a2", indexAction("actions", "action2")) @@ -224,7 +224,7 @@ public class WatchAckTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(cron("0/5 * * * * ? *"))) .input(searchInput(matchAllRequest().indices("events"))) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 0L)) .transform(searchTransform(matchAllRequest().indices("events"))) .addAction("_id", indexAction("actions", "action"))) .get(); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java index b22eaa506a7..65efab080ac 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java @@ -72,7 +72,7 @@ public class SlowWatchStatsTests extends AbstractWatcherIntegrationTestCase { public void run() { WatcherStatsResponse response = watcherClient().prepareWatcherStats().setIncludeCurrentWatches(true).get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); - assertThat(response.getWatchesCount(), equalTo(1l)); + assertThat(response.getWatchesCount(), equalTo(1L)); assertThat(response.getQueuedWatches(), nullValue()); assertThat(response.getSnapshots(), notNullValue()); assertThat(response.getSnapshots().size(), equalTo(1)); @@ -98,7 +98,7 @@ public class SlowWatchStatsTests extends AbstractWatcherIntegrationTestCase { public void run() { WatcherStatsResponse response = watcherClient().prepareWatcherStats().setIncludeQueuedWatches(true).get(); assertThat(response.getWatcherState(), equalTo(WatcherState.STARTED)); - assertThat(response.getWatchesCount(), equalTo(5l)); + assertThat(response.getWatchesCount(), equalTo(5L)); assertThat(response.getSnapshots(), nullValue()); assertThat(response.getQueuedWatches(), notNullValue()); assertThat(response.getQueuedWatches().size(), greaterThanOrEqualTo(5)); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java index d4b00af0ce0..1fc90aabcee 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java @@ -63,7 +63,7 @@ public class WatcherStatsTests extends AbstractWatcherIntegrationTestCase { .setSource(watchBuilder() .trigger(schedule(cron("* * * * * ? *"))) .input(searchInput(searchRequest)) - .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1l)) + .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)) ) .get();