refactor: narrow active app component scans
This commit is contained in:
@@ -2,6 +2,7 @@ package com.lingniu.ingest.eventhistory.config;
|
||||
|
||||
import com.lingniu.ingest.api.consumer.EnvelopeConsumerProcessor;
|
||||
import com.lingniu.ingest.api.consumer.EnvelopeDeadLetterSink;
|
||||
import com.lingniu.ingest.eventhistory.ApiExceptionHandler;
|
||||
import com.lingniu.ingest.eventhistory.EventHistoryEnvelopeIngestor;
|
||||
import com.lingniu.ingest.eventhistory.Gb32960DecodedFrameService;
|
||||
import com.lingniu.ingest.eventhistory.Gb32960FrameController;
|
||||
@@ -75,6 +76,12 @@ public class EventHistoryAutoConfiguration {
|
||||
return new EnvelopeConsumerProcessor("event-history-raw", ingestor, deadLetterSink);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public ApiExceptionHandler apiExceptionHandler() {
|
||||
return new ApiExceptionHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(Gb32960MessageDecoder.class)
|
||||
@ConditionalOnMissingBean
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.lingniu.ingest.eventhistory.config;
|
||||
|
||||
import com.lingniu.ingest.api.consumer.EnvelopeConsumerProcessor;
|
||||
import com.lingniu.ingest.api.consumer.EnvelopeDeadLetterSink;
|
||||
import com.lingniu.ingest.eventhistory.ApiExceptionHandler;
|
||||
import com.lingniu.ingest.eventhistory.EventHistoryEnvelopeIngestor;
|
||||
import com.lingniu.ingest.eventhistory.Gb32960DecodedFrameService;
|
||||
import com.lingniu.ingest.eventhistory.Gb32960FrameController;
|
||||
@@ -117,6 +118,7 @@ class EventHistoryAutoConfigurationTest {
|
||||
.run(context -> {
|
||||
assertThat(context).hasSingleBean(LocationHistoryController.class);
|
||||
assertThat(context).hasSingleBean(RawFrameHistoryController.class);
|
||||
assertThat(context).hasSingleBean(ApiExceptionHandler.class);
|
||||
assertThat(context).doesNotHaveBean(TelemetryFieldHistoryController.class);
|
||||
assertThat(context).doesNotHaveBean(Jt808LocationHistoryController.class);
|
||||
assertThat(context).doesNotHaveBean(Jt808RawFrameHistoryController.class);
|
||||
|
||||
Reference in New Issue
Block a user