Fix deprecation for RetryListenerSupport
Related to https://github.com/spring-projects/spring-retry/pull/326
This commit is contained in:
@@ -56,8 +56,8 @@ import org.springframework.messaging.MessagingException;
|
||||
import org.springframework.messaging.support.ErrorMessage;
|
||||
import org.springframework.retry.RetryCallback;
|
||||
import org.springframework.retry.RetryContext;
|
||||
import org.springframework.retry.RetryListener;
|
||||
import org.springframework.retry.backoff.NoBackOffPolicy;
|
||||
import org.springframework.retry.listener.RetryListenerSupport;
|
||||
import org.springframework.retry.policy.SimpleRetryPolicy;
|
||||
import org.springframework.retry.support.RetryTemplate;
|
||||
|
||||
@@ -379,14 +379,10 @@ class InboundGatewayTests {
|
||||
KafkaTemplate<Integer, String> template = new KafkaTemplate<>(pf);
|
||||
template.setDefaultTopic(topic7);
|
||||
KafkaInboundGateway<Integer, String, String> gateway = new KafkaInboundGateway<>(container, template);
|
||||
MessageChannel out = new DirectChannel() {
|
||||
|
||||
@Override
|
||||
protected boolean doSend(Message<?> message, long timeout) {
|
||||
throw new RuntimeException("intended");
|
||||
}
|
||||
|
||||
};
|
||||
MessageChannel out =
|
||||
(message, timeout) -> {
|
||||
throw new RuntimeException("intended");
|
||||
};
|
||||
gateway.setRequestChannel(out);
|
||||
gateway.setBeanFactory(mock(BeanFactory.class));
|
||||
gateway.setReplyTimeout(30_000);
|
||||
@@ -396,11 +392,12 @@ class InboundGatewayTests {
|
||||
retryTemplate.setRetryPolicy(retryPolicy);
|
||||
retryTemplate.setBackOffPolicy(new NoBackOffPolicy());
|
||||
final CountDownLatch retryCountLatch = new CountDownLatch(retryPolicy.getMaxAttempts());
|
||||
retryTemplate.registerListener(new RetryListenerSupport() {
|
||||
retryTemplate.registerListener(new RetryListener() {
|
||||
|
||||
@Override
|
||||
public <T, E extends Throwable> void onError(RetryContext context, RetryCallback<T, E> callback,
|
||||
Throwable throwable) {
|
||||
|
||||
retryCountLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.support.ErrorMessage;
|
||||
import org.springframework.retry.RetryCallback;
|
||||
import org.springframework.retry.RetryContext;
|
||||
import org.springframework.retry.listener.RetryListenerSupport;
|
||||
import org.springframework.retry.RetryListener;
|
||||
import org.springframework.retry.policy.SimpleRetryPolicy;
|
||||
import org.springframework.retry.support.RetryTemplate;
|
||||
|
||||
@@ -310,11 +310,12 @@ class MessageDrivenAdapterTests {
|
||||
retryPolicy.setMaxAttempts(2);
|
||||
retryTemplate.setRetryPolicy(retryPolicy);
|
||||
final CountDownLatch retryCountLatch = new CountDownLatch(retryPolicy.getMaxAttempts());
|
||||
retryTemplate.registerListener(new RetryListenerSupport() {
|
||||
retryTemplate.registerListener(new RetryListener() {
|
||||
|
||||
@Override
|
||||
public <T, E extends Throwable> void onError(RetryContext context, RetryCallback<T, E> callback,
|
||||
Throwable throwable) {
|
||||
|
||||
retryCountLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user