yanghua commented on a change in pull request #7262: [FLINK-10478] Kafka 
Producer wrongly formats % for transaction ID
URL: https://github.com/apache/flink/pull/7262#discussion_r239998555
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-0.11/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/TransactionalIdsGeneratorTest.java
 ##########
 @@ -45,6 +45,24 @@ public void testGenerateIdsToUse() {
                        generator.generateIdsToUse(36));
        }
 
+       @Test
+       public void testGenerateIdsWithPercentageToUse() {
+               TransactionalIdsGenerator generator = new 
TransactionalIdsGenerator("test%", 2, SUBTASKS_COUNT, POOL_SIZE, 
SAFE_SCALE_DOWN_FACTOR);
+
+               assertEquals(
+                       new HashSet<>(Arrays.asList("test%-42", "test%-43", 
"test%-44")),
+                       generator.generateIdsToUse(36));
+       }
+
+       @Test
+       public void testGenerateIdsWithMultiplePercentageToUse() {
+               TransactionalIdsGenerator generator = new 
TransactionalIdsGenerator("test%%", 2, SUBTASKS_COUNT, POOL_SIZE, 
SAFE_SCALE_DOWN_FACTOR);
 
 Review comment:
   ditto

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to