|
28 | 28 | import software.amazon.awssdk.services.kinesis.model.Consumer;
|
29 | 29 | import software.amazon.kinesis.common.InitialPositionInStream;
|
30 | 30 | import software.amazon.kinesis.common.InitialPositionInStreamExtended;
|
| 31 | +import software.amazon.kinesis.metrics.MetricsFactory; |
31 | 32 | import software.amazon.kinesis.metrics.MetricsLevel;
|
| 33 | +import software.amazon.kinesis.metrics.NullMetricsFactory; |
32 | 34 |
|
33 | 35 | import org.springframework.beans.factory.annotation.Autowired;
|
34 | 36 | import org.springframework.context.annotation.Bean;
|
@@ -123,15 +125,25 @@ void kclChannelAdapterReceivesRecords() {
|
123 | 125 | }
|
124 | 126 |
|
125 | 127 | @Test
|
126 |
| - public void metricsLevelOfMetricsFactoryShouldBeSetToMetricsLevelOfAdapter() { |
| 128 | + public void metricsLevelOfMetricsConfigShouldBeSetToMetricsLevelOfAdapter() { |
127 | 129 | MetricsLevel metricsLevel = TestUtils.getPropertyValue(
|
128 | 130 | this.kclMessageDrivenChannelAdapter,
|
129 |
| - "scheduler.metricsFactory.metricsLevel", |
| 131 | + "scheduler.metricsConfig.metricsLevel", |
130 | 132 | MetricsLevel.class
|
131 | 133 | );
|
132 | 134 | assertThat(metricsLevel).isEqualTo(MetricsLevel.NONE);
|
133 | 135 | }
|
134 | 136 |
|
| 137 | + @Test |
| 138 | + public void metricsFactoryOfSchedulerShouldBeSetNullMetricsFactoryIfMetricsLevelIsNone() { |
| 139 | + MetricsFactory metricsFactory = TestUtils.getPropertyValue( |
| 140 | + this.kclMessageDrivenChannelAdapter, |
| 141 | + "scheduler.metricsFactory", |
| 142 | + MetricsFactory.class |
| 143 | + ); |
| 144 | + assertThat(metricsFactory).isInstanceOf(NullMetricsFactory.class); |
| 145 | + } |
| 146 | + |
135 | 147 | @Configuration
|
136 | 148 | @EnableIntegration
|
137 | 149 | public static class TestConfiguration {
|
|
0 commit comments