DBZ-4466 Make REST extension tests independent of source code version
This commit is contained in:
parent
5a0f4d874e
commit
7c8af1c9c7
@ -44,6 +44,10 @@
|
|||||||
<artifactId>rest-assured</artifactId>
|
<artifactId>rest-assured</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.debezium</groupId>
|
||||||
|
<artifactId>debezium-core</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -75,10 +79,21 @@
|
|||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>**/META-INF/services/*</include>
|
<include>*</include>
|
||||||
|
<include>**/*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>*</include>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright Debezium Authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*/
|
||||||
|
package io.debezium.kcrestextension;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import io.debezium.util.IoUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about this module.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public final class Module {
|
||||||
|
|
||||||
|
private static final Properties INFO = IoUtil.loadProperties(Module.class, "io/debezium/kcrestextension/build.version");
|
||||||
|
|
||||||
|
public static String version() {
|
||||||
|
return INFO.getProperty("version");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
version=${project.version}
|
@ -24,12 +24,12 @@
|
|||||||
public class DebeziumResourceIT {
|
public class DebeziumResourceIT {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(DebeziumResourceIT.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(DebeziumResourceIT.class);
|
||||||
private static final String DEBEZIUM_VERSION = "1.7";
|
private static final String DEBEZIUM_CONTAINER_IMAGE_VERSION = "1.7";
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void start() {
|
public void start() {
|
||||||
TestHelper.stopContainers();
|
TestHelper.stopContainers();
|
||||||
TestHelper.setupDebeziumContainer(DEBEZIUM_VERSION);
|
TestHelper.setupDebeziumContainer(DEBEZIUM_CONTAINER_IMAGE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
|
@ -20,12 +20,12 @@
|
|||||||
*/
|
*/
|
||||||
public class DebeziumResourceNoTopicCreationIT {
|
public class DebeziumResourceNoTopicCreationIT {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(DebeziumResourceNoTopicCreationIT.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(DebeziumResourceNoTopicCreationIT.class);
|
||||||
private static final String DEBEZIUM_VERSION = "1.2";
|
private static final String DEBEZIUM_CONTAINER_IMAGE_VERSION = "1.2";
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void start() {
|
public void start() {
|
||||||
TestHelper.stopContainers();
|
TestHelper.stopContainers();
|
||||||
TestHelper.setupDebeziumContainer(DEBEZIUM_VERSION);
|
TestHelper.setupDebeziumContainer(DEBEZIUM_CONTAINER_IMAGE_VERSION);
|
||||||
TestHelper.startContainers();
|
TestHelper.startContainers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ public class TestHelper {
|
|||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TestHelper.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TestHelper.class);
|
||||||
|
|
||||||
private static final String KAFKA_HOSTNAME = "kafka-dbz-ui";
|
private static final String KAFKA_HOSTNAME = "kafka-dbz-ui";
|
||||||
|
private static final String DEBEZIUM_VERSION = Module.version();
|
||||||
|
|
||||||
public static final String API_PREFIX = "/debezium";
|
public static final String API_PREFIX = "/debezium";
|
||||||
public static final String TRANSFORMS_ENDPOINT = "/transforms";
|
public static final String TRANSFORMS_ENDPOINT = "/transforms";
|
||||||
@ -41,15 +42,15 @@ public static DebeziumContainer getDebeziumContainer() {
|
|||||||
return DEBEZIUM_CONTAINER;
|
return DEBEZIUM_CONTAINER;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setupDebeziumContainer(String debeziumVersion) {
|
public static void setupDebeziumContainer(String debeziumContainerImageVersion) {
|
||||||
DEBEZIUM_CONTAINER = new DebeziumContainer(DockerImageName.parse("debezium/connect:" + debeziumVersion))
|
DEBEZIUM_CONTAINER = new DebeziumContainer(DockerImageName.parse("debezium/connect:" + debeziumContainerImageVersion))
|
||||||
.withEnv("ENABLE_DEBEZIUM_SCRIPTING", "true")
|
.withEnv("ENABLE_DEBEZIUM_SCRIPTING", "true")
|
||||||
.withEnv("CONNECT_REST_EXTENSION_CLASSES", "io.debezium.kcrestextension.DebeziumConnectRestExtension")
|
.withEnv("CONNECT_REST_EXTENSION_CLASSES", "io.debezium.kcrestextension.DebeziumConnectRestExtension")
|
||||||
.withNetwork(NETWORK)
|
.withNetwork(NETWORK)
|
||||||
.withCopyFileToContainer(
|
.withCopyFileToContainer(
|
||||||
MountableFile.forHostPath(
|
MountableFile.forHostPath(
|
||||||
"target/debezium-connect-rest-extension-1.9.0-SNAPSHOT.jar"),
|
"target/debezium-connect-rest-extension-" + DEBEZIUM_VERSION + ".jar"),
|
||||||
"/kafka/libs/debezium-kcd-rest-extension-1.9.0.jar")
|
"/kafka/libs/debezium-kcd-rest-extension-" + DEBEZIUM_VERSION + ".jar")
|
||||||
.withKafka(KAFKA_CONTAINER.getNetwork(), KAFKA_HOSTNAME + ":9092")
|
.withKafka(KAFKA_CONTAINER.getNetwork(), KAFKA_HOSTNAME + ":9092")
|
||||||
.withLogConsumer(new Slf4jLogConsumer(LOGGER))
|
.withLogConsumer(new Slf4jLogConsumer(LOGGER))
|
||||||
.withStartupTimeout(Duration.ofSeconds(90))
|
.withStartupTimeout(Duration.ofSeconds(90))
|
||||||
|
Loading…
Reference in New Issue
Block a user