Skip to content

Commit 0be26bf

Browse files
Remove dead code from test codes.
1 parent 3b64536 commit 0be26bf

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicClassLevelIntegrationTests.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
import org.springframework.retry.annotation.Backoff;
8484
import org.springframework.scheduling.TaskScheduler;
8585
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
86-
import org.springframework.stereotype.Component;
8786
import org.springframework.test.annotation.DirtiesContext;
8887
import org.springframework.test.context.TestPropertySource;
8988
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@@ -94,6 +93,7 @@
9493
*
9594
* @author Wang Zhiyang
9695
* @author Artem Bilan
96+
* @author Sanghyeok An
9797
*
9898
* @since 3.2
9999
*/
@@ -304,7 +304,6 @@ private boolean awaitLatch(CountDownLatch latch) {
304304
}
305305
}
306306

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

325324
}
326325

327-
@Component
328326
@KafkaListener(topics = SECOND_TOPIC, containerFactory = MAIN_TOPIC_CONTAINER_FACTORY)
329327
static class SecondTopicListener {
330328

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

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

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

445441
}
446442

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

464459
}
465460

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

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

506499
}
507500

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

526518
}
527519

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

546537
}
547538

548-
@Component
549539
static class CountDownLatchContainer {
550540

551541
CountDownLatch countDownLatch1 = new CountDownLatch(5);
@@ -594,7 +584,6 @@ private void countDownIfNotKnown(String receivedTopic, CountDownLatch countDownL
594584
}
595585
}
596586

597-
@Component
598587
static class MyCustomDltProcessor {
599588

600589
@Autowired

spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicIntegrationTests.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
import org.springframework.retry.annotation.Backoff;
8585
import org.springframework.scheduling.TaskScheduler;
8686
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
87-
import org.springframework.stereotype.Component;
8887
import org.springframework.test.annotation.DirtiesContext;
8988
import org.springframework.test.context.TestPropertySource;
9089
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@@ -94,6 +93,7 @@
9493
* @author Tomaz Fernandes
9594
* @author Gary Russell
9695
* @author Wang Zhiyang
96+
* @author Sanghyeok An
9797
* @since 2.7
9898
*/
9999
@SpringJUnitConfig
@@ -315,7 +315,6 @@ private boolean awaitLatch(CountDownLatch latch) {
315315
}
316316
}
317317

318-
@Component
319318
static class FirstTopicListener {
320319

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

336335
}
337336

338-
@Component
339337
static class SecondTopicListener {
340338

341339
@Autowired
@@ -349,7 +347,6 @@ public void listenAgain(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) Str
349347
}
350348
}
351349

352-
@Component
353350
static class ThirdTopicListener {
354351

355352
@Autowired
@@ -377,7 +374,6 @@ public void annotatedDltMethod(Object message) {
377374
}
378375
}
379376

380-
@Component
381377
static class FourthTopicListener {
382378

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

466462
}
467463

468-
@Component
469464
static class SixthTopicDefaultDLTListener {
470465

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

485480
}
486481

487-
@Component
488482
static class NoRetryTopicListener {
489483

490484
@Autowired
@@ -507,7 +501,6 @@ public void annotatedDltMethod(Object message) {
507501
}
508502
}
509503

510-
@Component
511504
static class FirstReuseRetryTopicListener {
512505

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

528521
}
529522

530-
@Component
531523
static class SecondReuseRetryTopicListener {
532524

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

548540
}
549541

550-
@Component
551542
static class ThirdReuseRetryTopicListener {
552543

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

568559
}
569560

570-
@Component
571561
static class CountDownLatchContainer {
572562

573563
CountDownLatch countDownLatch1 = new CountDownLatch(5);
@@ -618,7 +608,6 @@ private void countDownIfNotKnown(String receivedTopic, CountDownLatch countDownL
618608
}
619609
}
620610

621-
@Component
622611
static class MyCustomDltProcessor {
623612

624613
@Autowired

0 commit comments

Comments
 (0)