remove lang url parameter from stored script requests (elastic/x-pack-elasticsearch#2029)

Original commit: elastic/x-pack-elasticsearch@1044c3ba53
This commit is contained in:
Jack Conradson 2017-07-20 08:51:27 -07:00 committed by GitHub
parent 5ecbbbd46d
commit e007fee9fb
2 changed files with 2 additions and 3 deletions

View File

@ -230,7 +230,6 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase {
public void testConditionSearchWithIndexedTemplate() throws Exception {
SearchSourceBuilder searchSourceBuilder = searchSource().query(matchQuery("level", "a"));
assertAcked(client().admin().cluster().preparePutStoredScript()
.setLang("mustache")
.setId("my-template")
.setContent(jsonBuilder().startObject().field("template").value(searchSourceBuilder).endObject().bytes(), XContentType.JSON)
.get());

View File

@ -120,8 +120,8 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas
logger.info("testing script transform with an indexed script");
assertAcked(client().admin().cluster().preparePutStoredScript()
.setId("my-script")
.setLang("mockscript")
.setContent(new BytesArray("{\"script\" : \"['key3' : ctx.payload.key1 + ctx.payload.key2]\"}"), XContentType.JSON)
.setContent(new BytesArray("{\"script\" : {\"lang\": \"" + MockScriptPlugin.NAME + "\", " +
"\"source\": \"['key3' : ctx.payload.key1 + ctx.payload.key2]\"}"), XContentType.JSON)
.get());
script = new Script(ScriptType.STORED, null, "my-script", Collections.emptyMap());
}