From ed262949163b285f291d820aae50b495bbf224da Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 4 May 2016 11:29:50 -0400 Subject: [PATCH] Fix HttpExporterTemplateTests from string split This commit fixes an issue in HttpExporterTemplateTests caused by the migration from Strings#splitStringToArray to String#split. Namely, the previous would split a string like "/x/y/z/" into { "x", "y", "z" } but the former will split this into { "", "x", "y", "z" }. This commit modifies the test logic to respond to this change. Original commit: elastic/x-pack-elasticsearch@c567b17180f51586e627ed20ff694adb609c335a --- .../marvel/agent/exporter/http/HttpExporterTemplateTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java index 06ae91054f0..c9dd36c7716 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java @@ -133,8 +133,8 @@ public class HttpExporterTemplateTests extends AbstractExporterTemplateTestCase String[] paths = request.getPath().split("/"); // Templates - if ((paths != null) && (paths.length > 0) && ("_template".equals(paths[0]))) { - String templateName = paths[1]; + if ((paths != null) && (paths.length > 1) && ("_template".equals(paths[1]))) { + String templateName = paths[2]; boolean templateExist = templates.containsKey(templateName); if ("GET".equals(request.getMethod())) {