dajac commented on a change in pull request #11912:
URL: https://github.com/apache/kafka/pull/11912#discussion_r829771763



##########
File path: 
clients/src/test/java/org/apache/kafka/common/requests/MetadataRequestTest.java
##########
@@ -20,6 +20,7 @@
 import org.apache.kafka.common.errors.UnsupportedVersionException;
 import org.apache.kafka.common.message.MetadataRequestData;
 import org.apache.kafka.common.protocol.ApiKeys;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

Review comment:
       nit: We usually put static imports after the imports. Could we move it 
down? I think that we could put it right before the other static imports.

##########
File path: 
clients/src/test/java/org/apache/kafka/common/requests/MetadataRequestTest.java
##########
@@ -74,20 +75,30 @@ public void testMetadataRequestVersion() {
     @Test
     public void testTopicIdAndNullTopicNameRequests() {
         // Construct invalid MetadataRequestTopics. We will build each one 
separately and ensure the error is thrown.
-        List<MetadataRequestData.MetadataRequestTopic> topics = Arrays.asList(
+        List<MetadataRequestData.MetadataRequestTopic> invalidTopics = 
Arrays.asList(
                 new 
MetadataRequestData.MetadataRequestTopic().setName(null).setTopicId(Uuid.randomUuid()),
                 new MetadataRequestData.MetadataRequestTopic().setName(null),
                 new 
MetadataRequestData.MetadataRequestTopic().setTopicId(Uuid.randomUuid()),
                 new 
MetadataRequestData.MetadataRequestTopic().setName("topic").setTopicId(Uuid.randomUuid()));
 
+        List<MetadataRequestData.MetadataRequestTopic> validTopics = 
Arrays.asList(

Review comment:
       nit: Would it make sense to split this test into two tests, one for the 
valid cases and one for the invalid cases? I think that it would be easier to 
read.

##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java
##########
@@ -151,7 +151,7 @@ public Cluster buildCluster() {
             if (metadata.error == Errors.NONE) {
                 if (metadata.isInternal)
                     internalTopics.add(metadata.topic);
-                if (metadata.topicId() != null && metadata.topicId() != 
Uuid.ZERO_UUID) {
+                if (metadata.topicId() != null && 
!Uuid.ZERO_UUID.equals(metadata.topicId())) {

Review comment:
       Could we add a unit test to cover this one?




-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to