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:
Stéphane Nicoll
2026-09-08 16:46:48 +02:00
parent f956f588d5
commit b1e91c942e
125 changed files with 201 additions and 356 deletions
@@ -49,7 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class PulsarAutoConfigurationIntegrationTests {
@Container
static final PulsarContainer pulsar = TestImage.container(PulsarContainer.class);
static final PulsarContainer pulsar = TestImage.forContainer(PulsarContainer.class);
private static final CountDownLatch listenLatch = new CountDownLatch(1);
@@ -57,7 +57,7 @@ class DeprecatedPulsarContainerConnectionDetailsFactoryIntegrationTests {
@Container
@ServiceConnection
@SuppressWarnings("unused")
static final PulsarContainer pulsar = TestImage.container(PulsarContainer.class);
static final PulsarContainer pulsar = TestImage.forContainer(PulsarContainer.class);
@Autowired
private PulsarTemplate<String> pulsarTemplate;
@@ -53,7 +53,7 @@ class PulsarContainerConnectionDetailsFactoryIntegrationTests {
@Container
@ServiceConnection
@SuppressWarnings("unused")
static final PulsarContainer pulsar = TestImage.container(PulsarContainer.class);
static final PulsarContainer pulsar = TestImage.forContainer(PulsarContainer.class);
@Autowired
private PulsarTemplate<String> pulsarTemplate;