atharvalade commented on code in PR #2718:
URL: https://github.com/apache/iggy/pull/2718#discussion_r2854941996
##########
foreign/java/java-sdk/src/test/java/org/apache/iggy/client/async/AsyncClientIntegrationTest.java:
##########
@@ -387,4 +388,245 @@ void testConcurrentOperations() throws Exception {
log.info("Successfully completed {} concurrent operations",
operations.size());
}
+
+ // ===== System client tests =====
+
+ @Test
+ @Order(11)
+ public void testGetStats() throws Exception {
+ log.info("Testing system getStats");
+
+ var stats = client.system().getStats().get(5, TimeUnit.SECONDS);
+
+ assertThat(stats).isNotNull();
+ log.info("Successfully retrieved server stats");
+ }
+
+ @Test
+ @Order(12)
+ public void testGetMe() throws Exception {
+ log.info("Testing system getMe");
+
+ var me = client.system().getMe().get(5, TimeUnit.SECONDS);
+
+ assertThat(me).isNotNull();
+ assertThat(me.clientId()).isGreaterThan(0);
+ log.info("Successfully retrieved current client info, clientId: {}",
me.clientId());
+ }
+
+ @Test
+ @Order(13)
+ public void testGetClients() throws Exception {
+ log.info("Testing system getClients");
+
+ var clients = client.system().getClients().get(5, TimeUnit.SECONDS);
+
+ assertThat(clients).isNotNull();
+ assertThat(clients).isNotEmpty();
+ log.info("Successfully retrieved {} connected clients",
clients.size());
+ }
+
+ @Test
+ @Order(14)
+ public void testGetClient() throws Exception {
+ log.info("Testing system getClient");
+
+ var me = client.system().getMe().get(5, TimeUnit.SECONDS);
+ var clientInfo = client.system().getClient(me.clientId()).get(5,
TimeUnit.SECONDS);
+
+ assertThat(clientInfo).isNotNull();
+ assertThat(clientInfo.clientId()).isEqualTo(me.clientId());
+ log.info("Successfully retrieved client info for clientId: {}",
clientInfo.clientId());
+ }
+
+ // ===== Consumer groups client tests =====
+
+ @Test
+ @Order(20)
+ public void testCreateAndGetConsumerGroup() throws Exception {
+ log.info("Testing consumer group create and get");
+
+ String groupName = "async-test-group";
+ var group = client.consumerGroups()
+ .createConsumerGroup(StreamId.of(TEST_STREAM),
TopicId.of(TEST_TOPIC), groupName)
+ .get(5, TimeUnit.SECONDS);
+
+ assertThat(group).isNotNull();
+ assertThat(group.name()).isEqualTo(groupName);
+ log.info("Successfully created consumer group: {}", group.name());
+
+ // Get by ID
+ var retrieved = client.consumerGroups()
+ .getConsumerGroup(StreamId.of(TEST_STREAM),
TopicId.of(TEST_TOPIC), ConsumerId.of(group.id()))
+ .get(5, TimeUnit.SECONDS);
+
+ assertThat(retrieved).isPresent();
+ assertThat(retrieved.get().id()).isEqualTo(group.id());
+ log.info("Successfully retrieved consumer group by ID: {}",
group.id());
+ }
+
+ @Test
+ @Order(21)
+ public void testGetConsumerGroups() throws Exception {
+ log.info("Testing consumer groups list");
+
+ var groups = client.consumerGroups()
+ .getConsumerGroups(StreamId.of(TEST_STREAM),
TopicId.of(TEST_TOPIC))
+ .get(5, TimeUnit.SECONDS);
+
+ assertThat(groups).isNotNull();
+ assertThat(groups).isNotEmpty();
+ log.info("Successfully retrieved {} consumer groups", groups.size());
+ }
+
+ @Test
+ @Order(22)
+ public void testDeleteConsumerGroup() throws Exception {
+ log.info("Testing consumer group deletion");
+
+ String groupName = "async-delete-group";
+ var group = client.consumerGroups()
+ .createConsumerGroup(StreamId.of(TEST_STREAM),
TopicId.of(TEST_TOPIC), groupName)
+ .get(5, TimeUnit.SECONDS);
+
+ client.consumerGroups()
+ .deleteConsumerGroup(StreamId.of(TEST_STREAM),
TopicId.of(TEST_TOPIC), ConsumerId.of(group.id()))
+ .get(5, TimeUnit.SECONDS);
+
+ var deleted = client.consumerGroups()
+ .getConsumerGroup(StreamId.of(TEST_STREAM),
TopicId.of(TEST_TOPIC), ConsumerId.of(group.id()))
+ .get(5, TimeUnit.SECONDS);
+
+ assertThat(deleted).isEmpty();
+ log.info("Successfully deleted consumer group: {}", groupName);
+ }
+
+ // ===== Consumer offsets client tests =====
+
+ @Test
+ @Order(30)
+ public void testStoreAndGetConsumerOffset() throws Exception {
+ log.info("Testing consumer offset store and get");
+
+ var consumer = new Consumer(Consumer.Kind.Consumer,
ConsumerId.of(5000L));
+ var offset = BigInteger.valueOf(42);
+
+ client.consumerOffsets()
Review Comment:
oh yes you're right
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]