You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/08/29 03:01:16 UTC

[GitHub] [james-project] Arsnael commented on a diff in pull request #1163: [BUILD] Reuse FakeSMTP container port 25

Arsnael commented on code in PR #1163:
URL: https://github.com/apache/james-project/pull/1163#discussion_r956855815


##########
server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java:
##########
@@ -62,13 +61,30 @@ public static void clean(RequestSpecification requestSpecification) {
     }
 
     public static FakeSmtp withSmtpPort(Integer smtpPort) {
-        DockerContainer container = fakeSmtpContainer()
-            .withExposedPorts(smtpPort)
-            .withCommands("node", "cli", "--listen", "80", "--smtp", smtpPort.toString());
+        DockerContainer container = reuseContainerIfPossible(smtpPort);
+
+        if (!container.isRunning()) {
+            container.start();
+        }
 
         return new FakeSmtp(container);
     }
 
+    private static DockerContainer reuseContainerIfPossible(Integer smtpPort) {
+        if (smtpPort == SMTP_PORT ) {

Review Comment:
   whitespace here :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org