Skip to content

Commit

Permalink
Merge pull request spring-projects#16685 from izeye
Browse files Browse the repository at this point in the history
* pr/16685:
  Polish
  • Loading branch information
snicoll committed Apr 30, 2019
2 parents a0d4253 + e22c2e5 commit 35b9ef9
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import org.springframework.kafka.support.converter.BatchMessagingMessageConverter;
import org.springframework.kafka.support.converter.MessagingMessageConverter;
import org.springframework.kafka.support.converter.RecordMessageConverter;
import org.springframework.kafka.test.utils.KafkaTestUtils;
import org.springframework.kafka.transaction.ChainedKafkaTransactionManager;
import org.springframework.kafka.transaction.KafkaAwareTransactionManager;
import org.springframework.kafka.transaction.KafkaTransactionManager;
Expand Down Expand Up @@ -285,8 +284,8 @@ public void adminProperties() {
.isEmpty();
assertThat(configs.get("foo.bar.baz")).isEqualTo("qux.fiz.buz");
assertThat(configs.get("fiz.buz")).isEqualTo("fix.fox");
assertThat(KafkaTestUtils.getPropertyValue(admin,
"fatalIfBrokerNotAvailable", Boolean.class)).isTrue();
assertThat(admin).hasFieldOrPropertyWithValue(
"fatalIfBrokerNotAvailable", true);
});
}

Expand Down Expand Up @@ -577,8 +576,8 @@ public void testConcurrentKafkaListenerContainerFactoryWithCustomErrorHandler()
.run((context) -> {
ConcurrentKafkaListenerContainerFactory<?, ?> factory = context
.getBean(ConcurrentKafkaListenerContainerFactory.class);
assertThat(KafkaTestUtils.getPropertyValue(factory, "errorHandler"))
.isSameAs(context.getBean("errorHandler"));
assertThat(factory).hasFieldOrPropertyWithValue("errorHandler",
context.getBean("errorHandler"));
});
}

Expand All @@ -588,8 +587,8 @@ public void concurrentKafkaListenerContainerFactoryInBatchModeShouldUseBatchErro
.withPropertyValues("spring.kafka.listener.type=batch").run((context) -> {
ConcurrentKafkaListenerContainerFactory<?, ?> factory = context
.getBean(ConcurrentKafkaListenerContainerFactory.class);
assertThat(KafkaTestUtils.getPropertyValue(factory, "errorHandler"))
.isSameAs(context.getBean("batchErrorHandler"));
assertThat(factory).hasFieldOrPropertyWithValue("errorHandler",
context.getBean("batchErrorHandler"));
});
}

Expand All @@ -599,8 +598,7 @@ public void concurrentKafkaListenerContainerFactoryInBatchModeWhenBatchErrorHand
.run((context) -> {
ConcurrentKafkaListenerContainerFactory<?, ?> factory = context
.getBean(ConcurrentKafkaListenerContainerFactory.class);
assertThat(KafkaTestUtils.getPropertyValue(factory, "errorHandler"))
.isNull();
assertThat(factory).hasFieldOrPropertyWithValue("errorHandler", null);
});
}

Expand All @@ -610,8 +608,7 @@ public void concurrentKafkaListenerContainerFactoryInBatchModeAndSimpleErrorHand
.withUserConfiguration(ErrorHandlerConfiguration.class).run((context) -> {
ConcurrentKafkaListenerContainerFactory<?, ?> factory = context
.getBean(ConcurrentKafkaListenerContainerFactory.class);
assertThat(KafkaTestUtils.getPropertyValue(factory, "errorHandler"))
.isNull();
assertThat(factory).hasFieldOrPropertyWithValue("errorHandler", null);
});
}

Expand Down

0 comments on commit 35b9ef9

Please sign in to comment.