@@ -118,10 +118,11 @@ void setUp() {
118
118
new Student ("2" , "Michael" , "Dunlop" ));
119
119
}
120
120
121
- @ AfterEach
122
- void tearDown () {
123
- personIndexOperations .delete ();
124
- studentIndexOperations .delete ();
121
+ @ Test
122
+ @ Order (Integer .MAX_VALUE )
123
+ void cleanup () {
124
+ operations .indexOps (IndexCoordinates .of (indexNameProvider .getPrefix () + '*' )).delete ();
125
+ }
125
126
}
126
127
127
128
@ Test // #1891
@@ -288,8 +289,11 @@ void shouldSearchWithTemplateMultiSearchWithMultipleIndexCoordinates() {
288
289
.build ();
289
290
290
291
// search with multiple index coordinates
291
- var multiSearchHits = operations .multiSearch (List .of (q1 , q2 ), List .of (Person .class , Student .class ),
292
- List .of (IndexCoordinates .of (indexNameProvider .indexName ()), IndexCoordinates .of ("another-index" )));
292
+ var multiSearchHits = operations .multiSearch (
293
+ List .of (q1 , q2 ),
294
+ List .of (Person .class , Student .class ),
295
+ List .of (IndexCoordinates .of (indexNameProvider .indexName () + "-person" ),
296
+ IndexCoordinates .of (indexNameProvider .indexName () + "-student" )));
293
297
294
298
assertThat (multiSearchHits .size ()).isEqualTo (2 );
295
299
assertThat (multiSearchHits .get (0 ).getTotalHits ()).isEqualTo (2 );
@@ -310,15 +314,15 @@ void shouldSearchWithTemplateMultiSearchWithMultipleIndexCoordinates() {
310
314
assertThat (operations .deleteScript (SCRIPT_SEARCH_LASTNAME .id ())).isTrue ();
311
315
}
312
316
313
- @ Document (indexName = "#{@indexNameProvider.indexName()}" )
317
+ @ Document (indexName = "#{@indexNameProvider.indexName()}-person " )
314
318
record Person ( //
315
319
@ Nullable @ Id String id , //
316
320
@ Field (type = FieldType .Text ) String firstName , //
317
321
@ Field (type = FieldType .Text ) String lastName //
318
322
) {
319
323
}
320
324
321
- @ Document (indexName = "another-index " )
325
+ @ Document (indexName = "#{@indexNameProvider.indexName()}-student " )
322
326
record Student ( //
323
327
@ Nullable @ Id String id , //
324
328
@ Field (type = FieldType .Text ) String firstName , //
0 commit comments