Polish "Add DataCouchbaseTest annotation"

See gh-29912
This commit is contained in:
Andy Wilkinson
2022-02-24 11:51:46 +00:00
parent 36e52758a7
commit 664ecbdcc1
4 changed files with 4 additions and 9 deletions

View File

@@ -339,7 +339,6 @@ boot-features-testing-spring-boot-applications-testing-autoconfigured-json-tests
boot-features-testing-spring-boot-applications-testing-autoconfigured-mvc-tests=features.testing.spring-boot-applications.spring-mvc-tests
boot-features-testing-spring-boot-applications-testing-autoconfigured-webflux-tests=features.testing.spring-boot-applications.spring-webflux-tests
boot-features-testing-spring-boot-applications-testing-autoconfigured-cassandra-test=features.testing.spring-boot-applications.autoconfigured-spring-data-cassandra
boot-features-testing-spring-boot-applications-testing-autoconfigured-couchbase-test=features.testing.spring-boot-applications.autoconfigured-spring-data-couchbase
boot-features-testing-spring-boot-applications-testing-autoconfigured-jpa-test=features.testing.spring-boot-applications.autoconfigured-spring-data-jpa
boot-features-testing-spring-boot-applications-testing-autoconfigured-jdbc-test=features.testing.spring-boot-applications.autoconfigured-jdbc
boot-features-testing-spring-boot-applications-testing-autoconfigured-data-jdbc-test=features.testing.spring-boot-applications.autoconfigured-spring-data-jdbc

View File

@@ -475,7 +475,7 @@ include::code:MyDataCassandraTests[]
[[features.testing.spring-boot-applications.autoconfigured-spring-data-couchbase]]
==== Auto-configured Data Couchbase Tests
You can use `@DataCouchbaseTest` to test Couchbase applications.
By default, it configures a `CouchbaseTemplate`, scans for `@Document` classes, and configures Spring Data Couchbase repositories.
By default, it configures a `CouchbaseTemplate` or `ReactiveCouchbaseTemplate`, scans for `@Document` classes, and configures Spring Data Couchbase repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataCouchbaseTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
(For more about using Couchbase with Spring Boot, see "<<data#data.nosql.couchbase>>", earlier in this chapter.)

View File

@@ -37,11 +37,11 @@ import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit.jupiter.SpringExtension;
/**
* Annotation that can be used for a Couchbase test that focuses <strong>only</strong> on
* Couchbase components.
* Annotation that can be used for a Data Couchbase test that focuses
* <strong>only</strong> on Data Couchbase components.
* <p>
* Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to Couchbase tests.
* configuration relevant to Data Couchbase tests.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.

View File

@@ -26,7 +26,6 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
import org.springframework.context.ApplicationContext;
import org.springframework.data.couchbase.core.ReactiveCouchbaseTemplate;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
@@ -64,9 +63,6 @@ class DataCouchbaseTestReactiveIntegrationTests {
@Autowired
private ExampleReactiveRepository exampleReactiveRepository;
@Autowired
private ApplicationContext applicationContext;
@Test
void testRepository() {
ExampleDocument document = new ExampleDocument();