refactor: remove file-store config from app runtimes
This commit is contained in:
@@ -92,8 +92,6 @@ lingniu:
|
||||
enabled: ${SINK_ARCHIVE_ENABLED:true}
|
||||
type: local
|
||||
path: ${SINK_ARCHIVE_PATH:./archive/}
|
||||
event-file-store:
|
||||
enabled: false
|
||||
event-history:
|
||||
enabled: false
|
||||
vehicle-state:
|
||||
|
||||
@@ -46,7 +46,6 @@ class YutongMqttAppCompositionTest {
|
||||
"lingniu.ingest.sink.mq.consumer.enabled=false",
|
||||
"lingniu.ingest.sink.archive.enabled=true",
|
||||
"lingniu.ingest.sink.archive.path=target/test-archive-yutong",
|
||||
"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 YutongMqttAppDefaultsTest {
|
||||
|
||||
@Test
|
||||
void applicationDefaultsKeepYutongMqttAsKafkaProducerOnly() {
|
||||
void applicationDefaultsKeepYutongMqttAsKafkaProducerOnly() throws IOException {
|
||||
Properties properties = applicationProperties();
|
||||
|
||||
assertThat(properties)
|
||||
@@ -34,10 +36,13 @@ class YutongMqttAppDefaultsTest {
|
||||
.containsEntry("lingniu.ingest.identity.mysql.table-name",
|
||||
"${VEHICLE_IDENTITY_MYSQL_TABLE:vehicle_identity_bindings}")
|
||||
.containsEntry("lingniu.ingest.sink.archive.enabled", "${SINK_ARCHIVE_ENABLED: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() {
|
||||
@@ -49,4 +54,9 @@ class YutongMqttAppDefaultsTest {
|
||||
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