@@ -454,7 +454,7 @@ void testWithCallbackFailureFunctional() throws Exception {
454
454
final CountDownLatch latch = new CountDownLatch (1 );
455
455
final AtomicReference <SendResult <Integer , String >> theResult = new AtomicReference <>();
456
456
AtomicReference <String > value = new AtomicReference <>();
457
- future .addCallback (result -> { }, (KafkaFailureCallback <Integer , String >) ex -> {
457
+ future .addCallback (result -> {}, (KafkaFailureCallback <Integer , String >) ex -> {
458
458
ProducerRecord <Integer , String > failed = ex .getFailedProducerRecord ();
459
459
value .set (failed .value ());
460
460
latch .countDown ();
@@ -525,65 +525,6 @@ void testConfigOverridesWithDefaultKafkaProducerFactory() {
525
525
assertThat (templateWTX2_2 .getProducerFactory ().getTransactionIdPrefix ()).isEqualTo ("TX2" );
526
526
}
527
527
528
- @ Test
529
- void testConfigOverridesWithCustomProducerFactory () {
530
- Map <String , Object > senderProps = KafkaTestUtils .producerProps (embeddedKafka );
531
- ProducerFactory <String , String > pf = new ProducerFactory <>() {
532
-
533
- @ Override
534
- public Producer <String , String > createProducer () {
535
- return null ;
536
- }
537
-
538
- @ Override
539
- public List <Listener <String , String >> getListeners () {
540
- return Collections .singletonList (noopListener );
541
- }
542
-
543
- @ Override
544
- public List <ProducerPostProcessor <String , String >> getPostProcessors () {
545
- return Collections .singletonList (noopProducerPostProcessor );
546
- }
547
-
548
- @ Override
549
- public Map <String , Object > getConfigurationProperties () {
550
- return Collections .singletonMap (ProducerConfig .ACKS_CONFIG , "all" );
551
- }
552
-
553
- @ Override
554
- public Duration getPhysicalCloseTimeout () {
555
- return Duration .ofSeconds (6 );
556
- }
557
-
558
- @ Override
559
- public boolean isProducerPerConsumerPartition () {
560
- return true ;
561
- }
562
-
563
- @ Override
564
- public boolean isProducerPerThread () {
565
- return false ;
566
- }
567
- };
568
-
569
- Map <String , Object > overrides = new HashMap <>();
570
- overrides .put (ProducerConfig .KEY_SERIALIZER_CLASS_CONFIG , StringSerializer .class );
571
- overrides .put (ProducerConfig .TRANSACTIONAL_ID_CONFIG , "TX" );
572
- KafkaTemplate <String , String > template = new KafkaTemplate <>(pf , true , overrides );
573
- assertThat (template .getProducerFactory ()).isOfAnyClassIn (DefaultKafkaProducerFactory .class );
574
- assertThat (template .getProducerFactory ().getConfigurationProperties ()
575
- .get (ProducerConfig .KEY_SERIALIZER_CLASS_CONFIG )).isEqualTo (StringSerializer .class );
576
- assertThat (template .getProducerFactory ().getPhysicalCloseTimeout ()).isEqualTo (Duration .ofSeconds (6 ));
577
- assertThat (template .getProducerFactory ().isProducerPerConsumerPartition ()).isTrue ();
578
- assertThat (template .getProducerFactory ().isProducerPerThread ()).isFalse ();
579
- assertThat (template .isTransactional ()).isTrue ();
580
- assertThat (template .getProducerFactory ().getListeners ()).isEqualTo (pf .getListeners ());
581
- assertThat (template .getProducerFactory ().getListeners ().size ()).isEqualTo (1 );
582
- assertThat (template .getProducerFactory ().getPostProcessors ()).isEqualTo (pf .getPostProcessors ());
583
- assertThat (template .getProducerFactory ().getPostProcessors ().size ()).isEqualTo (1 );
584
- assertThat (template .getProducerFactory ().getTransactionIdPrefix ()).isEqualTo ("TX" );
585
- }
586
-
587
528
@ Test
588
529
void testConfigOverridesWithSerializers () {
589
530
Map <String , Object > senderProps = KafkaTestUtils .producerProps (embeddedKafka );
0 commit comments