mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Fix CouchbaseReactiveRepositoriesAutoConfigurationTests
See gh-11151
This commit is contained in:
parent
116d763d52
commit
ef3d44f680
@ -16,15 +16,10 @@
|
||||
|
||||
package org.springframework.boot.autoconfigure.data.alt.couchbase;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.boot.autoconfigure.data.couchbase.city.City;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
|
||||
|
||||
public interface ReactiveCityCouchbaseRepository extends Repository<City, Long> {
|
||||
|
||||
Mono<City> save(City city);
|
||||
|
||||
Mono<City> findById(Long id);
|
||||
public interface ReactiveCityCouchbaseRepository extends
|
||||
ReactiveCrudRepository<City, Long> {
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.couchbase.CouchbaseTestConfigurer;
|
||||
import org.springframework.boot.autoconfigure.data.alt.couchbase.CityCouchbaseRepository;
|
||||
import org.springframework.boot.autoconfigure.data.alt.couchbase.ReactiveCityCouchbaseRepository;
|
||||
import org.springframework.boot.autoconfigure.data.couchbase.city.City;
|
||||
import org.springframework.boot.autoconfigure.data.couchbase.city.ReactiveCityRepository;
|
||||
@ -32,7 +31,7 @@ import org.springframework.boot.test.util.TestPropertyValues;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
import org.springframework.data.couchbase.repository.config.EnableReactiveCouchbaseRepositories;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@ -82,7 +81,7 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
|
||||
public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
|
||||
load(CustomizedConfiguration.class);
|
||||
assertThat(this.context.getBeansOfType(ReactiveCityCouchbaseRepository.class))
|
||||
.isEmpty();
|
||||
.isNotNull();
|
||||
}
|
||||
|
||||
private void load(Class<?> config, String... environment) {
|
||||
@ -116,7 +115,8 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
|
||||
|
||||
@Configuration
|
||||
@TestAutoConfigurationPackage(CouchbaseReactiveRepositoriesAutoConfigurationTests.class)
|
||||
@EnableMongoRepositories(basePackageClasses = CityCouchbaseRepository.class)
|
||||
@EnableReactiveCouchbaseRepositories(basePackageClasses = ReactiveCityCouchbaseRepository.class)
|
||||
@Import(CouchbaseTestConfigurer.class)
|
||||
protected static class CustomizedConfiguration {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user