Skip to content

Commit

Permalink
Tests: Fix array out of bounds exception in TemplateUpgradeServiceIT
Browse files Browse the repository at this point in the history
  • Loading branch information
imotov committed Jun 26, 2017
1 parent a34f5fa commit 2a4fb95
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public void testTemplateUpdate() throws Exception {
Settings.builder().put(TestPlugin.UPDATE_TEMPLATE_DUMMY_SETTING.getKey(), updateCount.incrementAndGet())
).get());
List<IndexTemplateMetaData> templates = client().admin().indices().prepareGetTemplates("test_*").get().getIndexTemplates();
assertThat(templates, hasSize(3));
boolean addedFound = false;
boolean changedFound = false;
boolean dummyFound = false;
Expand Down Expand Up @@ -140,7 +141,6 @@ public void testTemplateUpdate() throws Exception {
assertTrue(addedFound);
assertTrue(changedFound);
assertTrue(dummyFound);
assertThat(templates.size(), equalTo(3));
});

// Wipe out all templates
Expand All @@ -161,6 +161,7 @@ private void assertTemplates() throws Exception {
).get());

List<IndexTemplateMetaData> templates = client().admin().indices().prepareGetTemplates("test_*").get().getIndexTemplates();
assertThat(templates, hasSize(2));
boolean addedFound = false;
boolean changedFound = false;
for (int i = 0; i < 2; i++) {
Expand All @@ -183,7 +184,6 @@ private void assertTemplates() throws Exception {

assertTrue(addedFound);
assertTrue(changedFound);
assertThat(templates, hasSize(2));
});
}

Expand Down

0 comments on commit 2a4fb95

Please sign in to comment.