mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-01 23:09:01 +00:00
Add support for creating a container from a TestImage value
This commit improves TestImage so that an explicit image can trigger the creation of the container, with optional additional setup. This removes the need of creating additional container types for images that have multiple flavors, and to please the static method that can only create a container based on a single match. Closes gh-51082
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ class CouchbaseAutoConfigurationIntegrationTests {
|
||||
private static final String BUCKET_NAME = "cbbucket";
|
||||
|
||||
@Container
|
||||
static final CouchbaseContainer couchbase = TestImage.container(CouchbaseContainer.class)
|
||||
static final CouchbaseContainer couchbase = TestImage.forContainer(CouchbaseContainer.class)
|
||||
.withEnabledServices(CouchbaseService.KV)
|
||||
.withCredentials("spring", "password")
|
||||
.withBucket(new BucketDefinition(BUCKET_NAME).withPrimaryIndex(false));
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class CouchbaseContainerConnectionDetailsFactoryTests {
|
||||
|
||||
@Container
|
||||
@ServiceConnection
|
||||
static final CouchbaseContainer couchbase = TestImage.container(CouchbaseContainer.class)
|
||||
static final CouchbaseContainer couchbase = TestImage.forContainer(CouchbaseContainer.class)
|
||||
.withEnabledServices(CouchbaseService.KV, CouchbaseService.INDEX, CouchbaseService.QUERY)
|
||||
.withBucket(new BucketDefinition("cbbucket"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user