This is an automated email from the ASF dual-hosted git repository.
rmetzger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bahir-flink.git
The following commit(s) were added to refs/heads/master by this push:
new dabbb5f [hotfix] fix flume sink and utils test
dabbb5f is described below
commit dabbb5f32fd762943e707025d40f9572287bba4e
Author: raminqaf <[email protected]>
AuthorDate: Tue May 11 18:01:33 2021 +0200
[hotfix] fix flume sink and utils test
This closes #123
---
flink-connector-flume/pom.xml | 2 +-
.../connectors/flume/FlumeServerTest.java | 27 +++++++++++-----------
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/flink-connector-flume/pom.xml b/flink-connector-flume/pom.xml
index 984d2f9..df288aa 100644
--- a/flink-connector-flume/pom.xml
+++ b/flink-connector-flume/pom.xml
@@ -36,7 +36,7 @@ under the License.
<!-- Allow users to pass custom connector versions -->
<properties>
<flume-ng.version>1.9.0</flume-ng.version>
- <testcontainers.version>1.14.3</testcontainers.version>
+ <testcontainers.version>1.15.3</testcontainers.version>
</properties>
<dependencies>
diff --git
a/flink-connector-flume/src/test/java/org/apache/flink/streaming/connectors/flume/FlumeServerTest.java
b/flink-connector-flume/src/test/java/org/apache/flink/streaming/connectors/flume/FlumeServerTest.java
index 466d0ca..dbf5466 100644
---
a/flink-connector-flume/src/test/java/org/apache/flink/streaming/connectors/flume/FlumeServerTest.java
+++
b/flink-connector-flume/src/test/java/org/apache/flink/streaming/connectors/flume/FlumeServerTest.java
@@ -19,41 +19,42 @@ package org.apache.flink.streaming.connectors.flume;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;
+
public class FlumeServerTest {
private static final Integer EXPOSED_PORT = 44444;
+ private static final DockerImageName DOCKER_IMAGE_NAME =
DockerImageName.parse("eskabetxe/flume");
- public GenericContainer<?> sink = new GenericContainer<>("eskabetxe/flume")
-
+ private final GenericContainer<?> sink = new
GenericContainer<>(DOCKER_IMAGE_NAME)
.withCopyFileToContainer(MountableFile.forClasspathResource("docker/conf/sink.conf"),
"/opt/flume-config/flume.conf")
.withEnv("FLUME_AGENT_NAME", "docker");
- public GenericContainer<?> source = new
GenericContainer<>("eskabetxe/flume")
+ private final GenericContainer<?> source = new
GenericContainer<>(DOCKER_IMAGE_NAME)
.withCopyFileToContainer(MountableFile.forClasspathResource("docker/conf/source.conf"),
"/opt/flume-config/flume.conf")
.withExposedPorts(EXPOSED_PORT)
.withEnv("FLUME_AGENT_NAME", "docker")
- .dependsOn(sink);
+ .dependsOn(this.sink);
@BeforeEach
- void start() {
- sink.start();
- source.start();
+ void init() {
+ this.sink.start();
+ this.source.start();
}
@AfterEach
- void stop() {
- source.stop();
- sink.stop();
+ void tearDown() {
+ this.source.stop();
+ this.sink.stop();
}
protected String getHost() {
- return source.getHost();
+ return this.source.getHost();
}
protected Integer getPort() {
- return source.getMappedPort(EXPOSED_PORT);
+ return this.source.getMappedPort(EXPOSED_PORT);
}
-
}