chiradip commented on code in PR #2213:
URL: https://github.com/apache/iggy/pull/2213#discussion_r2400421972


##########
foreign/java/java-sdk/src/test/java/org/apache/iggy/client/async/AsyncClientIntegrationTest.java:
##########
@@ -0,0 +1,408 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iggy.client.async;
+
+import org.apache.iggy.client.async.tcp.AsyncIggyTcpClient;
+import org.apache.iggy.consumergroup.Consumer;
+import org.apache.iggy.identifier.StreamId;
+import org.apache.iggy.identifier.TopicId;
+import org.apache.iggy.message.Message;
+import org.apache.iggy.message.Partitioning;
+import org.apache.iggy.message.PollingStrategy;
+import org.apache.iggy.topic.CompressionAlgorithm;
+import org.junit.jupiter.api.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * Integration test for the complete async client flow.
+ * Tests connection, authentication, stream/topic management, and message 
operations.
+ */
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class AsyncClientIntegrationTest {
+    private static final Logger logger = 
LoggerFactory.getLogger(AsyncClientIntegrationTest.class);
+
+    private static final String HOST = "127.0.0.1";
+    private static final int PORT = 8090;
+    private static final String USERNAME = "iggy";
+    private static final String PASSWORD = "iggy";
+
+    private static final String TEST_STREAM = "async-test-stream-" + 
UUID.randomUUID();
+    private static final String TEST_TOPIC = "async-test-topic";
+    private static final long PARTITION_ID = 1L;
+
+    private static AsyncIggyTcpClient client;
+
+    @BeforeAll
+    public static void setup() throws Exception {
+        logger.info("Setting up async client for integration tests");
+        client = new AsyncIggyTcpClient(HOST, PORT);
+
+        // Connect and login
+        client.connect()
+            .thenCompose(v -> {
+                logger.info("Connected to Iggy server");
+                return client.login(USERNAME, PASSWORD);
+            })
+            .get(5, TimeUnit.SECONDS);
+
+        logger.info("Successfully logged in as: {}", USERNAME);
+    }
+
+    @AfterAll
+    public static void tearDown() throws Exception {
+        logger.info("Cleaning up test resources");
+
+        try {
+            // Clean up test stream if it exists
+            client.streams().deleteStreamAsync(StreamId.of(TEST_STREAM))
+                .get(5, TimeUnit.SECONDS);
+            logger.info("Deleted test stream: {}", TEST_STREAM);
+        } catch (Exception e) {
+            // Stream may not exist, which is fine
+            logger.debug("Stream cleanup failed (may not exist): {}", 
e.getMessage());
+        }
+
+        // Close the client
+        if (client != null) {
+            client.close().get(5, TimeUnit.SECONDS);
+            logger.info("Closed async client");
+        }
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateStream() throws Exception {
+        logger.info("Testing stream creation");
+
+        var streamDetails = client.streams()
+            .createStreamAsync(Optional.empty(), TEST_STREAM)
+            .get(5, TimeUnit.SECONDS);
+
+        assertNotNull(streamDetails);
+        assertEquals(TEST_STREAM, streamDetails.name());
+        logger.info("Successfully created stream: {}", streamDetails.name());
+    }
+
+    @Test
+    @Order(2)
+    public void testGetStream() throws Exception {
+        logger.info("Testing stream retrieval");
+
+        var streamOpt = client.streams()
+            .getStreamAsync(StreamId.of(TEST_STREAM))
+            .get(5, TimeUnit.SECONDS);
+
+        assertTrue(streamOpt.isPresent());

Review Comment:
   done 



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

Reply via email to