From 236ef558633e4fd41a00f47018dc5563a8ce230b Mon Sep 17 00:00:00 2001 From: David Turanski Date: Fri, 6 Nov 2020 12:32:33 -0500 Subject: [PATCH] Upgrade Testcontainers, Debezium, and fix exceptions in MailSupplierTests --- .../CdcSourceDatabasesIntegrationTest.java | 2 ++ .../common/cdc-debezium-boot-starter/pom.xml | 2 +- .../mail/AbstractMailSupplierTests.java | 31 ++++++++++++++----- stream-applications-build/pom.xml | 4 +-- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/applications/source/cdc-debezium-source/src/test/java/org/springframework/cloud/stream/app/source/cdc/CdcSourceDatabasesIntegrationTest.java b/applications/source/cdc-debezium-source/src/test/java/org/springframework/cloud/stream/app/source/cdc/CdcSourceDatabasesIntegrationTest.java index 7f0fed55..b26eac51 100644 --- a/applications/source/cdc-debezium-source/src/test/java/org/springframework/cloud/stream/app/source/cdc/CdcSourceDatabasesIntegrationTest.java +++ b/applications/source/cdc-debezium-source/src/test/java/org/springframework/cloud/stream/app/source/cdc/CdcSourceDatabasesIntegrationTest.java @@ -18,6 +18,7 @@ package org.springframework.cloud.stream.app.source.cdc; import java.util.List; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; import org.testcontainers.containers.GenericContainer; @@ -39,6 +40,7 @@ import static org.springframework.cloud.stream.app.source.cdc.CdcTestUtils.recei * @author Christian Tzolov * @author David Turanski */ +@Disabled("Run as needed if there is an issue with a specific connector") public class CdcSourceDatabasesIntegrationTest extends CdcTestSupport { private final SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder( diff --git a/functions/common/cdc-debezium-boot-starter/pom.xml b/functions/common/cdc-debezium-boot-starter/pom.xml index fa58ed95..80c3cb71 100644 --- a/functions/common/cdc-debezium-boot-starter/pom.xml +++ b/functions/common/cdc-debezium-boot-starter/pom.xml @@ -15,7 +15,7 @@ Change Data Capture (CDC) Debezium Boot Starter - 1.2.1.Final + 1.3.0.Final diff --git a/functions/supplier/mail-supplier/src/test/java/org/springframework/cloud/fn/supplier/mail/AbstractMailSupplierTests.java b/functions/supplier/mail-supplier/src/test/java/org/springframework/cloud/fn/supplier/mail/AbstractMailSupplierTests.java index 4e1ff995..c717b65b 100644 --- a/functions/supplier/mail-supplier/src/test/java/org/springframework/cloud/fn/supplier/mail/AbstractMailSupplierTests.java +++ b/functions/supplier/mail-supplier/src/test/java/org/springframework/cloud/fn/supplier/mail/AbstractMailSupplierTests.java @@ -19,23 +19,27 @@ package org.springframework.cloud.fn.supplier.mail; import java.util.function.Supplier; import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import reactor.core.publisher.Flux; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.integration.dsl.StandardIntegrationFlow; +import org.springframework.integration.test.context.SpringIntegrationTest; import org.springframework.integration.test.mail.TestMailServer; import org.springframework.messaging.Message; import org.springframework.test.annotation.DirtiesContext; import static org.assertj.core.api.Assertions.assertThat; -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, - properties = { - "mail.supplier.mark-as-read=true", - "mail.supplier.delete=false", - "mail.supplier.user-flag=testSIUserFlag", - "mail.supplier.java-mail-properties=mail.imap.socketFactory.fallback=true\\n mail.store.protocol=imap\\n mail.debug=true"}) +@SpringIntegrationTest(noAutoStartup = "*") +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, properties = { + "mail.supplier.mark-as-read=true", + "mail.supplier.delete=false", + "mail.supplier.user-flag=testSIUserFlag", + "mail.supplier.java-mail-properties=mail.imap.socketFactory.fallback=true\\n mail.store.protocol=imap\\n mail.debug=true" }) @DirtiesContext public class AbstractMailSupplierTests { @@ -44,6 +48,9 @@ public class AbstractMailSupplierTests { @Autowired protected Supplier>> mailSupplier; + @Autowired + private StandardIntegrationFlow integrationFlow; + protected static void startMailServer(TestMailServer.MailServer mailServer) throws InterruptedException { MAIL_SERVER = mailServer; @@ -55,13 +62,21 @@ public class AbstractMailSupplierTests { assertThat(n < 100).isTrue(); } + @BeforeEach + void start() { + integrationFlow.start(); + } + + @AfterEach + void stop() { + integrationFlow.stop(); + } + @AfterAll public static void cleanup() { System.clearProperty("test.mail.server.port"); - MAIL_SERVER.stop(); } - @SpringBootApplication public static class MailSupplierTestApplication { diff --git a/stream-applications-build/pom.xml b/stream-applications-build/pom.xml index eaa7a076..a31dd64b 100644 --- a/stream-applications-build/pom.xml +++ b/stream-applications-build/pom.xml @@ -44,8 +44,8 @@ 2.6.2 2.2.11.RELEASE 3.0.9.RELEASE - 5.3.3.BUILD-SNAPSHOT - 1.15.0-rc2 + 5.3.3.RELEASE + 1.15.0 1.2.5 2.22.2