Skip to content

Commit 4168d2f

Browse files
committed
test: Use list collections to check for auth instead of health check
Signed-off-by: Anush008 <anushshetty90@gmail.com>
1 parent 22c78dd commit 4168d2f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/test/java/io/qdrant/client/ApiKeyTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.grpc.ManagedChannel;
1010
import io.grpc.Status;
1111
import io.grpc.StatusRuntimeException;
12+
import io.qdrant.client.grpc.Collections.ListCollectionsRequest;
1213
import io.qdrant.client.grpc.QdrantOuterClass.HealthCheckReply;
1314
import io.qdrant.client.grpc.QdrantOuterClass.HealthCheckRequest;
1415
import java.util.concurrent.ExecutionException;
@@ -61,7 +62,8 @@ public void client_without_api_key_cannot_connect() {
6162
ExecutionException executionException =
6263
assertThrows(
6364
ExecutionException.class,
64-
() -> grpcClient.qdrant().healthCheck(HealthCheckRequest.getDefaultInstance()).get());
65+
() ->
66+
grpcClient.collections().list(ListCollectionsRequest.getDefaultInstance()).get());
6567
Throwable cause = executionException.getCause();
6668
assertEquals(StatusRuntimeException.class, cause.getClass());
6769
StatusRuntimeException statusRuntimeException = (StatusRuntimeException) cause;

0 commit comments

Comments
 (0)