@@ -113,6 +113,7 @@ public void testTemplateUpdate() throws Exception {
113113 Settings .builder ().put (TestPlugin .UPDATE_TEMPLATE_DUMMY_SETTING .getKey (), updateCount .incrementAndGet ())
114114 ).get ());
115115 List <IndexTemplateMetaData > templates = client ().admin ().indices ().prepareGetTemplates ("test_*" ).get ().getIndexTemplates ();
116+ assertThat (templates , hasSize (3 ));
116117 boolean addedFound = false ;
117118 boolean changedFound = false ;
118119 boolean dummyFound = false ;
@@ -140,7 +141,6 @@ public void testTemplateUpdate() throws Exception {
140141 assertTrue (addedFound );
141142 assertTrue (changedFound );
142143 assertTrue (dummyFound );
143- assertThat (templates .size (), equalTo (3 ));
144144 });
145145
146146 // Wipe out all templates
@@ -161,6 +161,7 @@ private void assertTemplates() throws Exception {
161161 ).get ());
162162
163163 List <IndexTemplateMetaData > templates = client ().admin ().indices ().prepareGetTemplates ("test_*" ).get ().getIndexTemplates ();
164+ assertThat (templates , hasSize (2 ));
164165 boolean addedFound = false ;
165166 boolean changedFound = false ;
166167 for (int i = 0 ; i < 2 ; i ++) {
@@ -183,7 +184,6 @@ private void assertTemplates() throws Exception {
183184
184185 assertTrue (addedFound );
185186 assertTrue (changedFound );
186- assertThat (templates , hasSize (2 ));
187187 });
188188 }
189189
0 commit comments