Skip to content

Commit c552c92

Browse files
committed
refactor: add suppress warnings for unchecked exception
Signed-off-by: Chaedong Im <chaedong.im.dev@gmail.com>
1 parent 14cceef commit c552c92

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

spring-kafka/src/test/java/org/springframework/kafka/listener/AckModeRecordFilteredTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
*/
4848
public class AckModeRecordFilteredTest {
4949

50+
@SuppressWarnings("unchecked")
5051
@Test
5152
public void testRecordFilteredModeOnlyCommitsProcessedRecords() throws InterruptedException {
5253
// Given: A container with RECORD_FILTERED ack mode
@@ -103,6 +104,7 @@ public void testRecordFilteredModeOnlyCommitsProcessedRecords() throws Interrupt
103104
verify(consumer, times(2)).commitSync(any(), any(Duration.class));
104105
}
105106

107+
@SuppressWarnings("unchecked")
106108
@Test
107109
public void testRecordFilteredModeWithAllRecordsFiltered() throws InterruptedException {
108110
// Given: All records are filtered
@@ -150,6 +152,7 @@ public void testRecordFilteredModeWithAllRecordsFiltered() throws InterruptedExc
150152
verify(consumer, never()).commitSync(any(), any(Duration.class));
151153
}
152154

155+
@SuppressWarnings("unchecked")
153156
@Test
154157
public void testRecordFilteredModeWithMixedPartitions() throws InterruptedException {
155158
// Given: Mixed partitions with different filtering scenarios
@@ -212,6 +215,7 @@ public void testRecordFilteredModeWithMixedPartitions() throws InterruptedExcept
212215
verify(consumer, times(3)).commitSync(any(), any(Duration.class));
213216
}
214217

218+
@SuppressWarnings("unchecked")
215219
@Test
216220
public void testRecordFilteredModeEfficiencyGains() throws InterruptedException {
217221
ConsumerFactory<String, String> consumerFactory = mock(ConsumerFactory.class);
@@ -264,6 +268,7 @@ public void testRecordFilteredModeEfficiencyGains() throws InterruptedException
264268
verify(consumer, times(1)).commitSync(any(), any(Duration.class));
265269
}
266270

271+
@SuppressWarnings("unchecked")
267272
@Test
268273
public void testRecordFilteredModeDoesNotBreakNormalProcessing() throws InterruptedException {
269274
ConsumerFactory<String, String> consumerFactory = mock(ConsumerFactory.class);

spring-kafka/src/test/java/org/springframework/kafka/listener/AckModeRecordWithFilteringTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
*/
4949
public class AckModeRecordWithFilteringTest {
5050

51+
@SuppressWarnings("unchecked")
5152
@Test
5253
public void testCurrentRecordModeCommitsAllRecords() throws InterruptedException {
5354
// Given: A container with RECORD ack mode and a filter that filters out even offsets
@@ -104,6 +105,7 @@ public void testCurrentRecordModeCommitsAllRecords() throws InterruptedException
104105
verify(consumer, times(4)).commitSync(any(), any(Duration.class));
105106
}
106107

108+
@SuppressWarnings("unchecked")
107109
@Test
108110
public void testAllRecordsFilteredStillCommits() throws InterruptedException {
109111
// Given: A container where all records are filtered
@@ -151,6 +153,7 @@ public void testAllRecordsFilteredStillCommits() throws InterruptedException {
151153
verify(consumer, times(2)).commitSync(any(), any(Duration.class));
152154
}
153155

156+
@SuppressWarnings("unchecked")
154157
@Test
155158
public void testMixedPartitionsWithFiltering() throws InterruptedException {
156159
// Given: Multiple partitions with different records
@@ -214,6 +217,7 @@ record -> record.value().contains("skip");
214217
verify(consumer, times(5)).commitSync(any(), any(Duration.class));
215218
}
216219

220+
@SuppressWarnings("unchecked")
217221
@Test
218222
public void testCommitLogging() throws InterruptedException {
219223
ConsumerFactory<String, String> consumerFactory = mock(ConsumerFactory.class);
@@ -260,6 +264,7 @@ public void testCommitLogging() throws InterruptedException {
260264
verify(consumer, times(2)).commitSync(anyMap(), any(Duration.class));
261265
}
262266

267+
@SuppressWarnings("unchecked")
263268
@Test
264269
public void testAckDiscardedParameterBehavior() throws InterruptedException {
265270
ConsumerFactory<String, String> consumerFactory = mock(ConsumerFactory.class);

0 commit comments

Comments
 (0)