Fix CouchbaseReactiveRepositoriesAutoConfigurationTests

See gh-11151
pull/11156/merge
Eddú Meléndez 7 years ago committed by Stephane Nicoll
parent 116d763d52
commit ef3d44f680

@ -16,15 +16,10 @@
package org.springframework.boot.autoconfigure.data.alt.couchbase; 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.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.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration; import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration;
import org.springframework.boot.autoconfigure.couchbase.CouchbaseTestConfigurer; 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.alt.couchbase.ReactiveCityCouchbaseRepository;
import org.springframework.boot.autoconfigure.data.couchbase.city.City; import org.springframework.boot.autoconfigure.data.couchbase.city.City;
import org.springframework.boot.autoconfigure.data.couchbase.city.ReactiveCityRepository; 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.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; 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; import static org.assertj.core.api.Assertions.assertThat;
@ -82,7 +81,7 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() { public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
load(CustomizedConfiguration.class); load(CustomizedConfiguration.class);
assertThat(this.context.getBeansOfType(ReactiveCityCouchbaseRepository.class)) assertThat(this.context.getBeansOfType(ReactiveCityCouchbaseRepository.class))
.isEmpty(); .isNotNull();
} }
private void load(Class<?> config, String... environment) { private void load(Class<?> config, String... environment) {
@ -116,7 +115,8 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
@Configuration @Configuration
@TestAutoConfigurationPackage(CouchbaseReactiveRepositoriesAutoConfigurationTests.class) @TestAutoConfigurationPackage(CouchbaseReactiveRepositoriesAutoConfigurationTests.class)
@EnableMongoRepositories(basePackageClasses = CityCouchbaseRepository.class) @EnableReactiveCouchbaseRepositories(basePackageClasses = ReactiveCityCouchbaseRepository.class)
@Import(CouchbaseTestConfigurer.class)
protected static class CustomizedConfiguration { protected static class CustomizedConfiguration {
} }

Loading…
Cancel
Save