Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code from test codes. #3545

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
import org.springframework.retry.annotation.Backoff;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.stereotype.Component;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
Expand All @@ -94,6 +93,7 @@
*
* @author Wang Zhiyang
* @author Artem Bilan
* @author Sanghyeok An
*
* @since 3.2
*/
Expand Down Expand Up @@ -304,7 +304,6 @@ private boolean awaitLatch(CountDownLatch latch) {
}
}

@Component
@KafkaListener(id = "firstTopicId", topics = FIRST_TOPIC, containerFactory = MAIN_TOPIC_CONTAINER_FACTORY,
errorHandler = "myCustomErrorHandler", contentTypeConverter = "myCustomMessageConverter",
concurrency = "2")
Expand All @@ -324,7 +323,6 @@ public void listen(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String r

}

@Component
@KafkaListener(topics = SECOND_TOPIC, containerFactory = MAIN_TOPIC_CONTAINER_FACTORY)
static class SecondTopicListener {

Expand All @@ -338,7 +336,6 @@ public void listenAgain(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) Str
}
}

@Component
@RetryableTopic(attempts = "${five.attempts}",
backoff = @Backoff(delay = 250, maxDelay = 1000, multiplier = 1.5),
numPartitions = "#{3}",
Expand All @@ -365,7 +362,6 @@ public void annotatedDltMethod(Object message) {
}
}

@Component
@RetryableTopic(dltStrategy = DltStrategy.NO_DLT, attempts = "4", backoff = @Backoff(300),
sameIntervalTopicReuseStrategy = SameIntervalTopicReuseStrategy.MULTIPLE_TOPICS,
kafkaTemplate = "${kafka.template}")
Expand Down Expand Up @@ -444,7 +440,6 @@ public void listenWithAnnotation2(String message, @Header(KafkaHeaders.RECEIVED_

}

@Component
@RetryableTopic(attempts = "4", backoff = @Backoff(50),
sameIntervalTopicReuseStrategy = SameIntervalTopicReuseStrategy.MULTIPLE_TOPICS)
@KafkaListener(id = "manual", topics = MANUAL_TOPIC, containerFactory = MAIN_TOPIC_CONTAINER_FACTORY)
Expand All @@ -463,7 +458,6 @@ public void listenNoDlt(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) Str

}

@Component
@RetryableTopic(attempts = "3", numPartitions = "3", exclude = MyDontRetryException.class,
backoff = @Backoff(delay = 50, maxDelay = 100, multiplier = 3),
traversingCauses = "true", kafkaTemplate = "${kafka.template}")
Expand All @@ -485,7 +479,6 @@ public void annotatedDltMethod(Object message) {
}
}

@Component
@RetryableTopic(attempts = "2", backoff = @Backoff(50))
@KafkaListener(id = "reuseRetry1", topics = FIRST_REUSE_RETRY_TOPIC,
containerFactory = "retryTopicListenerContainerFactory")
Expand All @@ -505,7 +498,6 @@ public void listen1(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String

}

@Component
@RetryableTopic(attempts = "5", backoff = @Backoff(delay = 30, maxDelay = 100, multiplier = 2))
@KafkaListener(id = "reuseRetry2", topics = SECOND_REUSE_RETRY_TOPIC,
containerFactory = "retryTopicListenerContainerFactory")
Expand All @@ -525,7 +517,6 @@ public void listen2(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String

}

@Component
@RetryableTopic(attempts = "5", backoff = @Backoff(delay = 1, maxDelay = 5, multiplier = 1.4))
@KafkaListener(id = "reuseRetry3", topics = THIRD_REUSE_RETRY_TOPIC,
containerFactory = "retryTopicListenerContainerFactory")
Expand All @@ -545,7 +536,6 @@ public void listen3(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String

}

@Component
static class CountDownLatchContainer {

CountDownLatch countDownLatch1 = new CountDownLatch(5);
Expand Down Expand Up @@ -594,7 +584,6 @@ private void countDownIfNotKnown(String receivedTopic, CountDownLatch countDownL
}
}

@Component
static class MyCustomDltProcessor {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
import org.springframework.retry.annotation.Backoff;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.stereotype.Component;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
Expand All @@ -94,6 +93,7 @@
* @author Tomaz Fernandes
* @author Gary Russell
* @author Wang Zhiyang
* @author Sanghyeok An
* @since 2.7
*/
@SpringJUnitConfig
Expand Down Expand Up @@ -315,7 +315,6 @@ private boolean awaitLatch(CountDownLatch latch) {
}
}

@Component
static class FirstTopicListener {

@Autowired
Expand All @@ -335,7 +334,6 @@ public void listen(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String r

}

@Component
static class SecondTopicListener {

@Autowired
Expand All @@ -349,7 +347,6 @@ public void listenAgain(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) Str
}
}

@Component
static class ThirdTopicListener {

@Autowired
Expand Down Expand Up @@ -377,7 +374,6 @@ public void annotatedDltMethod(Object message) {
}
}

@Component
static class FourthTopicListener {

@Autowired
Expand Down Expand Up @@ -465,7 +461,6 @@ public void annotatedDltMethod(ConsumerRecord<?, ?> record) {

}

@Component
static class SixthTopicDefaultDLTListener {

@Autowired
Expand All @@ -484,7 +479,6 @@ public void listenNoDlt(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) Str

}

@Component
static class NoRetryTopicListener {

@Autowired
Expand All @@ -507,7 +501,6 @@ public void annotatedDltMethod(Object message) {
}
}

@Component
static class FirstReuseRetryTopicListener {

final List<String> topics = Collections.synchronizedList(new ArrayList<>());
Expand All @@ -527,7 +520,6 @@ public void listen1(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String

}

@Component
static class SecondReuseRetryTopicListener {

final List<String> topics = Collections.synchronizedList(new ArrayList<>());
Expand All @@ -547,7 +539,6 @@ public void listen2(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String

}

@Component
static class ThirdReuseRetryTopicListener {

final List<String> topics = Collections.synchronizedList(new ArrayList<>());
Expand All @@ -567,7 +558,6 @@ public void listen3(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String

}

@Component
static class CountDownLatchContainer {

CountDownLatch countDownLatch1 = new CountDownLatch(5);
Expand Down Expand Up @@ -618,7 +608,6 @@ private void countDownIfNotKnown(String receivedTopic, CountDownLatch countDownL
}
}

@Component
static class MyCustomDltProcessor {

@Autowired
Expand Down