refactor: remove file-store config from app runtimes

This commit is contained in:
lingniu
2026-07-01 03:42:57 +08:00
parent 3908c1e752
commit 6bcf46034d
12 changed files with 48 additions and 20 deletions

View File

@@ -83,8 +83,6 @@ lingniu:
dlq: ${KAFKA_TOPIC_JT808_DLQ:vehicle.dlq.jt808.v1}
consumer:
enabled: false
event-file-store:
enabled: false
event-history:
enabled: false
vehicle-state:

View File

@@ -47,7 +47,6 @@ class Jt808IngestAppCompositionTest {
"lingniu.ingest.sink.mq.consumer.enabled=false",
"lingniu.ingest.sink.archive.enabled=true",
"lingniu.ingest.sink.archive.path=target/test-archive-jt808",
"lingniu.ingest.event-file-store.enabled=false",
"lingniu.ingest.event-history.enabled=false",
"lingniu.ingest.vehicle-state.enabled=false",
"lingniu.ingest.vehicle-stat.enabled=false");

View File

@@ -4,6 +4,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Properties;
import static org.assertj.core.api.Assertions.assertThat;
@@ -11,7 +13,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class Jt808IngestAppDefaultsTest {
@Test
void applicationDefaultsKeepJt808IngestAsTcpKafkaProducerOnly() {
void applicationDefaultsKeepJt808IngestAsTcpKafkaProducerOnly() throws IOException {
Properties properties = applicationProperties();
assertThat(properties)
@@ -41,10 +43,13 @@ class Jt808IngestAppDefaultsTest {
.containsEntry("lingniu.ingest.identity.mysql.password", "${VEHICLE_IDENTITY_MYSQL_PASSWORD:}")
.containsEntry("lingniu.ingest.identity.mysql.initialize-schema",
"${VEHICLE_IDENTITY_MYSQL_INITIALIZE_SCHEMA:true}")
.containsEntry("lingniu.ingest.event-file-store.enabled", false)
.containsEntry("lingniu.ingest.event-history.enabled", false)
.containsEntry("lingniu.ingest.vehicle-state.enabled", false)
.containsEntry("lingniu.ingest.vehicle-stat.enabled", false);
assertThat(properties.stringPropertyNames())
.noneMatch(name -> name.startsWith("lingniu.ingest.event-file-store."));
assertThat(applicationYaml()).doesNotContain("event-file-store:");
}
private static Properties applicationProperties() {
@@ -56,4 +61,9 @@ class Jt808IngestAppDefaultsTest {
assertThat(properties).isNotNull();
return properties;
}
private static String applicationYaml() throws IOException {
return new String(new ClassPathResource("application.yml").getInputStream().readAllBytes(),
StandardCharsets.UTF_8);
}
}