rindavis commented on code in PR #20936:
URL: https://github.com/apache/pulsar/pull/20936#discussion_r1286121133
##########
pulsar-client/src/test/java/org/apache/pulsar/client/impl/ConsumerBuilderImplTest.java:
##########
@@ -346,6 +349,36 @@ public void testNullDeadLetterPolicy() {
verify(consumerBuilderImpl.getConf()).setDeadLetterPolicy(null);
}
+ @Test
+ public void testNonNullDeadLetterPolicy() {
+ PulsarClientImpl client = mock(PulsarClientImpl.class);
+ ConsumerConfigurationData consumerConfigurationData =
mock(ConsumerConfigurationData.class);
+
doCallRealMethod().when(consumerConfigurationData).setDeadLetterPolicy(any());
+
when(consumerConfigurationData.getDeadLetterPolicy()).thenCallRealMethod();
+ ConsumerBuilderImpl<byte[]> consumerBuilder = new
ConsumerBuilderImpl(client, consumerConfigurationData, Schema.BYTES);
+
+ consumerBuilder.deadLetterPolicy(DeadLetterPolicy.builder()
+ .retryLetterTopic("new-retry")
+ .initialSubscriptionName("new-dlq-sub")
+ .deadLetterTopic("new-dlq")
+ .maxRedeliverCount(2)
+ .deadLetterBatchingEnabled(false)
+ .deadLetterChunkingEnabled(false)
+ .retryLetterBatchingEnabled(true)
+ .retryLetterChunkingEnabled(true)
Review Comment:
Corrected the test case. Do we need to add validation somewhere else in this
changeset, or is having it in the `ProducerBuilderImpl` enough?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]