fix: align yutong mqtt portainer env
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.lingniu.ingest.yutongmqttapp;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class YutongMqttPortainerComposeTest {
|
||||
|
||||
@Test
|
||||
void portainerComposeUsesYutongMqttApplicationEnvironmentNames() throws IOException {
|
||||
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
|
||||
|
||||
assertThat(compose)
|
||||
.contains("KAFKA_TOPIC_YUTONG_MQTT_EVENT:")
|
||||
.contains("KAFKA_TOPIC_YUTONG_MQTT_RAW:")
|
||||
.contains("KAFKA_TOPIC_YUTONG_MQTT_DLQ:")
|
||||
.contains("YUTONG_MQTT_ENABLED: ${YUTONG_MQTT_ENABLED:-true}")
|
||||
.contains("YUTONG_MQTT_URI: ${YUTONG_MQTT_URI:-tcp://127.0.0.1:1883}")
|
||||
.contains("YUTONG_MQTT_TOPIC: \"${YUTONG_MQTT_TOPIC:-#}\"")
|
||||
.doesNotContain("KAFKA_TOPIC_PARTNER_EVENT")
|
||||
.doesNotContain("KAFKA_TOPIC_PARTNER_RAW")
|
||||
.doesNotContain("KAFKA_TOPIC_PARTNER_DLQ")
|
||||
.doesNotContain("\n MQTT_ENABLED:")
|
||||
.doesNotContain("\n MQTT_URI:")
|
||||
.doesNotContain("\n MQTT_TOPIC:");
|
||||
}
|
||||
|
||||
private static Path repositoryRoot() {
|
||||
Path current = Path.of(System.getProperty("user.dir")).toAbsolutePath();
|
||||
while (current != null) {
|
||||
if (Files.exists(current.resolve("deploy/portainer/docker-compose.yml"))) {
|
||||
return current;
|
||||
}
|
||||
current = current.getParent();
|
||||
}
|
||||
throw new IllegalStateException("repository root not found");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user