Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR] Unused testGroups method #1090

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

g1geordie
Copy link
Contributor

remove testGroups method

@@ -96,23 +96,6 @@ void testQuerySingleGroup() {
}
}

@Test
void testGroups() {
Copy link
Contributor

Choose a reason for hiding this comment

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

請問一下為何他是沒用到的?這不是一隻測試嗎?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

主要是 test 跟下面這個很像
並且 handler 沒有使用到

  @Test
  void testListGroups() {
    var topicName = Utils.randomString(10);
    var groupId = Utils.randomString(10);
    try (var admin = Admin.of(bootstrapServers())) {
      admin.creator().topic(topicName).run().toCompletableFuture().join();
      Utils.sleep(Duration.ofSeconds(3));
      try (var consumer =
          Consumer.forTopics(Set.of(topicName))
              .config(ConsumerConfigs.GROUP_ID_CONFIG, groupId)
              .bootstrapServers(bootstrapServers())
              .build()) {
        Assertions.assertEquals(0, consumer.poll(Duration.ofSeconds(3)).size());
        var handler = new GroupHandler(admin);
        var response =
            Assertions.assertInstanceOf(
                GroupHandler.Groups.class, handler.get(Channel.EMPTY).toCompletableFuture().join());
        var group = response.groups.stream().filter(g -> g.groupId.equals(groupId)).findAny().get();
        Assertions.assertEquals(1, group.members.size());
        group.members.forEach(m -> Assertions.assertNull(m.groupInstanceId));
      }
    }
  }

Copy link
Contributor

Choose a reason for hiding this comment

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

了解,+1 to remove it

@chia7712 chia7712 merged commit af19ae5 into opensource4you:main Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants