feat(self-operated): persist continuous collection and frozen coverage
This commit is contained in:
+13
-2
@@ -7,12 +7,23 @@ import java.util.List;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
class LingxingEgressPropertiesTest {
|
||||
@Test void continuousBusinessFlagBindsOnlyWhenExplicitlyEnabled() {
|
||||
String prefix = "baiyue.integration.lingxing-wms.egress";
|
||||
var input = new java.util.HashMap<String, String>();
|
||||
input.put(prefix + ".collection-mode", "BUSINESS");
|
||||
var source = new org.springframework.boot.context.properties.source.MapConfigurationPropertySource(input);
|
||||
var binder = new org.springframework.boot.context.properties.bind.Binder(source);
|
||||
var target = org.springframework.boot.context.properties.bind.Bindable.of(LingxingEgressProperties.class);
|
||||
assertThat(binder.bind(prefix, target).get().continuousBusinessCollectionEnabled()).isFalse();
|
||||
source.put(prefix + ".continuous-business-collection-enabled", "true");
|
||||
assertThat(binder.bind(prefix, target).get().continuousBusinessCollectionEnabled()).isTrue();
|
||||
}
|
||||
private LingxingEgressProperties properties(CollectionMode mode, Duration interval, Duration cooldown) {
|
||||
return new LingxingEgressProperties(mode, "test", null, null, null, null, interval, cooldown);
|
||||
return new LingxingEgressProperties(mode, "test", null, null, null, null, interval, cooldown, false);
|
||||
}
|
||||
|
||||
@Test void businessAcceptsPositiveMillisecondIntervalsIncludingProbeSteps() {
|
||||
for (long millis : new long[]{1, 1500, 2000, 3000, 5000, 300000}) {
|
||||
for (long millis : new long[]{1, 1200, 1500, 2000, 3000, 5000, 300000}) {
|
||||
assertThat(properties(CollectionMode.BUSINESS, Duration.ofMillis(millis), null).minStartInterval())
|
||||
.isEqualTo(Duration.ofMillis(millis));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user