mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-25 13:32:10 +00:00
Remove all indices after testing.
Original Pull Request #2373 Closes #2372
This commit is contained in:
parent
bae182b162
commit
9f63369c4b
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.data.elasticsearch.repository.config;
|
package org.springframework.data.elasticsearch.repository.config;
|
||||||
|
|
||||||
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
|
import static org.springframework.data.elasticsearch.annotations.FieldType.Text;
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions;
|
import org.assertj.core.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@ -26,6 +26,7 @@ import org.springframework.context.annotation.Import;
|
|||||||
import org.springframework.data.annotation.Id;
|
import org.springframework.data.annotation.Id;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
import org.springframework.data.elasticsearch.annotations.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.Field;
|
import org.springframework.data.elasticsearch.annotations.Field;
|
||||||
|
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
|
||||||
import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchRestTemplateConfiguration;
|
import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchRestTemplateConfiguration;
|
||||||
import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest;
|
import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest;
|
||||||
import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository;
|
import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository;
|
||||||
@ -36,6 +37,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||||||
* @author Christoph Strobl
|
* @author Christoph Strobl
|
||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
@ContextConfiguration(classes = { ReactiveElasticsearchRepositoriesRegistrarTests.Config.class })
|
@ContextConfiguration(classes = { ReactiveElasticsearchRepositoriesRegistrarTests.Config.class })
|
||||||
public class ReactiveElasticsearchRepositoriesRegistrarTests {
|
public class ReactiveElasticsearchRepositoriesRegistrarTests {
|
||||||
@ -45,6 +47,7 @@ public class ReactiveElasticsearchRepositoriesRegistrarTests {
|
|||||||
@EnableReactiveElasticsearchRepositories(considerNestedRepositories = true)
|
@EnableReactiveElasticsearchRepositories(considerNestedRepositories = true)
|
||||||
static class Config {}
|
static class Config {}
|
||||||
|
|
||||||
|
@Autowired ReactiveElasticsearchOperations operations;
|
||||||
@Autowired ReactiveSampleEntityRepository repository;
|
@Autowired ReactiveSampleEntityRepository repository;
|
||||||
@Autowired ApplicationContext context;
|
@Autowired ApplicationContext context;
|
||||||
|
|
||||||
@ -54,6 +57,9 @@ public class ReactiveElasticsearchRepositoriesRegistrarTests {
|
|||||||
Assertions.assertThat(context).isNotNull();
|
Assertions.assertThat(context).isNotNull();
|
||||||
Assertions.assertThat(repository).isNotNull();
|
Assertions.assertThat(repository).isNotNull();
|
||||||
|
|
||||||
|
// there is an index to delete after this test
|
||||||
|
operations.indexOps(ReactiveElasticsearchRepositoryConfigurationExtensionUnitTests.SwCharacter.class).delete()
|
||||||
|
.block();
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ReactiveSampleEntityRepository extends ReactiveElasticsearchRepository<SampleEntity, String> {}
|
interface ReactiveSampleEntityRepository extends ReactiveElasticsearchRepository<SampleEntity, String> {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user