Fix tests after SI update
This commit is contained in:
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.cloud.stream.binding;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -404,8 +404,9 @@ public class BindingService {
|
||||
}
|
||||
|
||||
private void scheduleTask(Runnable task) {
|
||||
this.taskScheduler.schedule(task, new Date(System.currentTimeMillis()
|
||||
+ this.bindingServiceProperties.getBindingRetryInterval() * 1_000));
|
||||
Date d = new Date(System.currentTimeMillis()
|
||||
+ this.bindingServiceProperties.getBindingRetryInterval() * 1_000);
|
||||
this.taskScheduler.schedule(task, d.toInstant());
|
||||
}
|
||||
|
||||
private void assertNotIllegalException(RuntimeException exception)
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
@@ -36,6 +38,8 @@ import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -75,7 +79,7 @@ public class PollableSourceTests {
|
||||
PollerMetadata pollerMetadata = context.getBean(PollerMetadata.class);
|
||||
assertThat(pollerMetadata.getTrigger()).isInstanceOf(PeriodicTrigger.class);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "fixedRate")).isEqualTo(false);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "period")).isEqualTo(1000L);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "period")).isEqualTo(Duration.ofSeconds(1));
|
||||
assertThat(pollerMetadata.getMaxMessagesPerPoll()).isEqualTo(1);
|
||||
}
|
||||
}
|
||||
@@ -91,7 +95,7 @@ public class PollableSourceTests {
|
||||
PollerMetadata pollerMetadata = context.getBean(PollerMetadata.class);
|
||||
assertThat(pollerMetadata.getTrigger()).isInstanceOf(PeriodicTrigger.class);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "fixedRate")).isEqualTo(false);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "period")).isEqualTo(7000L);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "period")).isEqualTo(Duration.ofSeconds(7));
|
||||
assertThat(pollerMetadata.getMaxMessagesPerPoll()).isEqualTo(13);
|
||||
}
|
||||
}
|
||||
@@ -105,7 +109,7 @@ public class PollableSourceTests {
|
||||
PollerMetadata pollerMetadata = context.getBean(PollerMetadata.class);
|
||||
assertThat(pollerMetadata.getTrigger()).isInstanceOf(PeriodicTrigger.class);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "fixedRate")).isEqualTo(true);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "period")).isEqualTo(200L);
|
||||
assertThat(TestUtils.getPropertyValue(pollerMetadata.getTrigger(), "period")).isEqualTo(Duration.ofMillis(200));
|
||||
assertThat(pollerMetadata.getMaxMessagesPerPoll()).isEqualTo(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user