refactor: remove file-store config from app runtimes
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user