Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions core/src/test/java/kafka/test/ClusterConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -96,4 +98,16 @@ public void testDisksPerBrokerIsZero() {
.setDisksPerBroker(0)
.build());
}

@Test
public void testDisplayTags() {
List<String> tags = Collections.singletonList("tag");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use multi tags and then verify all of them are existent in displayTags?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chia7712 I addressed multi tags in my latest commit.

ClusterConfig clusterConfig = ClusterConfig.defaultBuilder().setTags(tags).build();

Set<String> expectedDisplayTags = clusterConfig.displayTags();

Assertions.assertTrue(expectedDisplayTags.contains("tag"));
Assertions.assertTrue(expectedDisplayTags.contains("MetadataVersion=" + MetadataVersion.latestTesting()));
Assertions.assertTrue(expectedDisplayTags.contains("Security=" + SecurityProtocol.PLAINTEXT));
}
}