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@c567b17180
This commit is contained in:
parent
5b12eef2d3
commit
ed26294916
|
@ -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())) {
|
||||
|
|
Loading…
Reference in New Issue