ajamato commented on a change in pull request #12137:
URL: https://github.com/apache/beam/pull/12137#discussion_r448143856



##########
File path: 
sdks/java/io/rabbitmq/src/test/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqIOTest.java
##########
@@ -396,18 +394,18 @@ public void testWriteQueue() throws Exception {
       connection = connectionFactory.newConnection();
       channel = connection.createChannel();
       channel.queueDeclare("TEST", true, false, false, null);
-      Consumer consumer = new RabbitMqTestUtils.TestConsumer(channel, 
received);
+      RabbitMqTestUtils.TestConsumer consumer = new 
RabbitMqTestUtils.TestConsumer(channel);
       channel.basicConsume("TEST", true, consumer);
 
       p.run();
 
-      while (received.size() < maxNumRecords) {
+      while (consumer.getReceived().size() < maxNumRecords) {
         Thread.sleep(500);
       }
 
-      assertEquals(maxNumRecords, received.size());
+      assertEquals(maxNumRecords, consumer.getReceived().size());

Review comment:
       nit: I doubt this matters because you only add elements to the received 
list. but might be safer style to use the same reference instead of calling 
getReceived() 3 times. Which ensures the exact same snapshot. Up to you if you 
want to change it.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to