mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-08 18:41:37 +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
@@ -44,7 +44,7 @@ class GrafanaOtlpLoggingContainerConnectionDetailsFactoryTests {
|
||||
|
||||
@Container
|
||||
@ServiceConnection
|
||||
static final LgtmStackContainer container = TestImage.container(LgtmStackContainer.class);
|
||||
static final LgtmStackContainer container = TestImage.forContainer(LgtmStackContainer.class);
|
||||
|
||||
@Autowired
|
||||
private OtlpLoggingConnectionDetails connectionDetails;
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ class OtelCollectorOltpLoggingContainerConnectionDetailsFactoryTests {
|
||||
|
||||
@Container
|
||||
@ServiceConnection
|
||||
static final GenericContainer<?> container = TestImage.OTEL_COLLECTOR.genericContainer()
|
||||
.withExposedPorts(4317, 4318);
|
||||
static final GenericContainer<?> container = TestImage.OTEL_COLLECTOR
|
||||
.container((setup) -> setup.withExposedPorts(4317, 4318));
|
||||
|
||||
@Autowired
|
||||
private OtlpLoggingConnectionDetails connectionDetails;
|
||||
|
||||
Reference in New Issue
Block a user