diff --git a/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java b/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java index eb9af66a..6ae8fcf9 100644 --- a/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java +++ b/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java @@ -49,6 +49,13 @@ import java.nio.file.Path; @ConditionalOnProperty(prefix = "lingniu.ingest.event-history", name = "enabled", havingValue = "true") public class EventHistoryAutoConfiguration { + @Bean + @ConditionalOnProperty(prefix = "lingniu.ingest.tdengine-history", name = "telemetry-fields-enabled") + public Object rejectedRemovedTelemetryFieldsSwitch() { + throw new IllegalStateException( + "tdengine-history.telemetry-fields-enabled has been removed; history stores raw_frames and location rows only"); + } + @Bean @ConditionalOnBean(TdengineHistoryWriter.class) @ConditionalOnMissingBean diff --git a/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfigurationTest.java b/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfigurationTest.java index 9d7a9e09..7d3377fd 100644 --- a/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfigurationTest.java +++ b/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfigurationTest.java @@ -143,13 +143,17 @@ class EventHistoryAutoConfigurationTest { } @Test - void doesNotExposeTelemetryFieldHistoryControllerWhenTelemetryFieldsAreEnabled() { + void rejectsRemovedTelemetryFieldsSwitch() { contextRunner .withPropertyValues( "lingniu.ingest.event-history.enabled=true", "lingniu.ingest.tdengine-history.telemetry-fields-enabled=true") .withBean(TdengineHistoryReader.class, () -> mock(TdengineHistoryReader.class)) - .run(context -> assertThat(context).doesNotHaveBean("telemetryFieldHistoryController")); + .run(context -> assertThat(context) + .hasFailed() + .getFailure() + .hasMessageContaining("tdengine-history.telemetry-fields-enabled has been removed") + .hasMessageContaining("raw_frames")); } @Test