chore: derive history kafka groups in app

This commit is contained in:
lingniu
2026-07-01 15:22:14 +08:00
parent 192c5eff00
commit 9cd5c5a35d
2 changed files with 10 additions and 17 deletions

View File

@@ -294,19 +294,18 @@ class PortainerComposeResourceLimitsTest {
}
@Test
void vehicleHistoryUsesApplicationConsumerGroupEnvironmentNames() throws IOException {
void vehicleHistoryOnlyExposesBaseConsumerGroupEnvironmentName() throws IOException {
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
String historyService = serviceBlock(compose, "vehicle-history-app");
assertThat(compose)
.contains("KAFKA_GROUP_HISTORY_GB32960_EVENT: ${KAFKA_GROUP_HISTORY_GB32960_EVENT:-${KAFKA_GROUP_HISTORY:-vehicle-history}-gb32960-event}")
.contains("KAFKA_GROUP_HISTORY_JT808_EVENT: ${KAFKA_GROUP_HISTORY_JT808_EVENT:-${KAFKA_GROUP_HISTORY:-vehicle-history}-jt808-event}")
.contains("KAFKA_GROUP_HISTORY_YUTONG_MQTT_EVENT: ${KAFKA_GROUP_HISTORY_YUTONG_MQTT_EVENT:-${KAFKA_GROUP_HISTORY:-vehicle-history}-yutong-mqtt-event}")
.contains("KAFKA_GROUP_HISTORY_GB32960_RAW: ${KAFKA_GROUP_HISTORY_GB32960_RAW:-${KAFKA_GROUP_HISTORY:-vehicle-history}-gb32960-raw}")
.contains("KAFKA_GROUP_HISTORY_JT808_RAW: ${KAFKA_GROUP_HISTORY_JT808_RAW:-${KAFKA_GROUP_HISTORY:-vehicle-history}-jt808-raw}")
.contains("KAFKA_GROUP_HISTORY_YUTONG_MQTT_RAW: ${KAFKA_GROUP_HISTORY_YUTONG_MQTT_RAW:-${KAFKA_GROUP_HISTORY:-vehicle-history}-yutong-mqtt-raw}")
.doesNotContain("\n KAFKA_GROUP_HISTORY_GB32960:")
.doesNotContain("\n KAFKA_GROUP_HISTORY_JT808:")
.doesNotContain("\n KAFKA_GROUP_HISTORY_MQTT_YUTONG:");
assertThat(historyService)
.contains("KAFKA_GROUP_HISTORY: ${KAFKA_GROUP_HISTORY:-vehicle-history}")
.doesNotContain("KAFKA_GROUP_HISTORY_GB32960_EVENT")
.doesNotContain("KAFKA_GROUP_HISTORY_JT808_EVENT")
.doesNotContain("KAFKA_GROUP_HISTORY_YUTONG_MQTT_EVENT")
.doesNotContain("KAFKA_GROUP_HISTORY_GB32960_RAW")
.doesNotContain("KAFKA_GROUP_HISTORY_JT808_RAW")
.doesNotContain("KAFKA_GROUP_HISTORY_YUTONG_MQTT_RAW");
}
@Test