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:
+2
-2
@@ -92,7 +92,7 @@ class MailSenderAutoConfigurationIntegrationTests {
|
||||
class ImplicitTlsTests {
|
||||
|
||||
@Container
|
||||
private static final MailpitContainer mailpit = TestImage.container(MailpitContainer.class)
|
||||
private static final MailpitContainer mailpit = TestImage.forContainer(MailpitContainer.class)
|
||||
.withSmtpRequireTls(true)
|
||||
.withSmtpTlsCert(MountableFile
|
||||
.forClasspathResource("/org/springframework/boot/mail/autoconfigure/ssl/test-server.crt"))
|
||||
@@ -153,7 +153,7 @@ class MailSenderAutoConfigurationIntegrationTests {
|
||||
class StarttlsTests {
|
||||
|
||||
@Container
|
||||
private static final MailpitContainer mailpit = TestImage.container(MailpitContainer.class)
|
||||
private static final MailpitContainer mailpit = TestImage.forContainer(MailpitContainer.class)
|
||||
.withSmtpRequireStarttls(true)
|
||||
.withSmtpTlsCert(MountableFile
|
||||
.forClasspathResource("/org/springframework/boot/mail/autoconfigure/ssl/test-server.crt"))
|
||||
|
||||
Reference in New Issue
Block a user