3131import static java .util .stream .IntStream .range ;
3232import static java .util .stream .IntStream .rangeClosed ;
3333import static org .junit .jupiter .api .Assertions .assertAll ;
34+ import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
3435import static org .junit .jupiter .api .Assertions .assertEquals ;
3536import static org .junit .jupiter .api .Assertions .assertFalse ;
3637import static org .junit .jupiter .api .Assertions .assertIterableEquals ;
5354import org .apache .kafka .connect .data .Schema ;
5455import org .apache .kafka .connect .data .SchemaBuilder ;
5556import org .apache .kafka .connect .data .Struct ;
56- import org .apache .kafka .connect .errors .ConnectException ;
5757import org .apache .kafka .connect .errors .DataException ;
5858import org .apache .kafka .connect .source .SourceRecord ;
5959import org .apache .kafka .connect .source .SourceTask ;
@@ -483,6 +483,7 @@ void testSourceCanUseCustomOffsetPartitionNames() {
483483 {
484484 put (MongoSourceConfig .DATABASE_CONFIG , coll .getNamespace ().getDatabaseName ());
485485 put (MongoSourceConfig .COLLECTION_CONFIG , coll .getNamespace ().getCollectionName ());
486+ put (MongoSourceConfig .OVERRIDE_ERRORS_TOLERANCE_CONFIG , "all" );
486487 put (MongoSourceConfig .POLL_MAX_BATCH_SIZE_CONFIG , "50" );
487488 put (MongoSourceConfig .POLL_AWAIT_TIME_MS_CONFIG , "5000" );
488489 put (MongoSourceConfig .OFFSET_PARTITION_NAME_CONFIG , "oldPartitionName" );
@@ -494,8 +495,7 @@ void testSourceCanUseCustomOffsetPartitionNames() {
494495 .thenReturn (INVALID_OFFSET );
495496 task .initialize (context );
496497
497- assertThrows (
498- ConnectException .class ,
498+ assertDoesNotThrow (
499499 () -> {
500500 task .start (cfg );
501501 getNextBatch (task );
0 commit comments