From 4dab138db78ba518e66bc0be1c3d7327fa12e99e Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 3 Sep 2014 14:04:55 +0200 Subject: [PATCH] [TEST] resolved warning in IndexedScriptTests --- .../org/elasticsearch/script/IndexedScriptTests.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/elasticsearch/script/IndexedScriptTests.java b/src/test/java/org/elasticsearch/script/IndexedScriptTests.java index 3024b0ec6dc..a01fd8a0f8c 100644 --- a/src/test/java/org/elasticsearch/script/IndexedScriptTests.java +++ b/src/test/java/org/elasticsearch/script/IndexedScriptTests.java @@ -38,7 +38,7 @@ public class IndexedScriptTests extends ElasticsearchIntegrationTest { @Test public void testFieldIndexedScript() throws ExecutionException, InterruptedException{ - List builders = new ArrayList(); + List builders = new ArrayList<>(); builders.add(client().prepareIndex(ScriptService.SCRIPT_INDEX, "groovy", "script1").setSource("{" + "\"script\":\"2\""+ "}").setTimeout(TimeValue.timeValueSeconds(randomIntBetween(2,10)))); @@ -57,11 +57,10 @@ public class IndexedScriptTests extends ElasticsearchIntegrationTest { builders.add(client().prepareIndex("test", "scriptTest", "4").setSource("{\"theField\":\"foo 4\"}")); builders.add(client().prepareIndex("test", "scriptTest", "5").setSource("{\"theField\":\"bar\"}")); - indexRandom(true,builders); - SearchResponse searchResponse; + indexRandom(true, builders); String query = "{ \"query\" : { \"match_all\": {}} , \"script_fields\" : { \"test1\" : { \"script_id\" : \"script1\", \"lang\":\"groovy\" }, \"test2\" : { \"script_id\" : \"script2\", \"lang\":\"groovy\", \"params\":{\"factor\":3} }}, size:1}"; - searchResponse = client().prepareSearch().setSource(query).setIndices("test").setTypes("scriptTest").get(); - assertHitCount(searchResponse,5); + SearchResponse searchResponse = client().prepareSearch().setSource(query).setIndices("test").setTypes("scriptTest").get(); + assertHitCount(searchResponse, 5); assertTrue(searchResponse.getHits().hits().length == 1); SearchHit sh = searchResponse.getHits().getAt(0); assertThat((Integer)sh.field("test1").getValue(), equalTo(2));