99import io .grpc .ManagedChannel ;
1010import io .grpc .Status ;
1111import io .grpc .StatusRuntimeException ;
12- import io .qdrant .client .grpc .QdrantOuterClass . HealthCheckReply ;
13- import io .qdrant .client .grpc .QdrantOuterClass . HealthCheckRequest ;
12+ import io .qdrant .client .grpc .Collections . ListCollectionsRequest ;
13+ import io .qdrant .client .grpc .Collections . ListCollectionsResponse ;
1414import java .util .concurrent .ExecutionException ;
1515import java .util .concurrent .TimeUnit ;
1616import org .junit .jupiter .api .AfterEach ;
@@ -44,15 +44,14 @@ public void teardown() throws InterruptedException {
4444
4545 @ Test
4646 public void client_with_api_key_can_connect () throws ExecutionException , InterruptedException {
47- HealthCheckReply healthCheckReply ;
47+ ListCollectionsResponse listCollectionsResponse ;
4848 try (QdrantGrpcClient grpcClient =
4949 QdrantGrpcClient .newBuilder (channel ).withApiKey ("password!" ).build ()) {
50- healthCheckReply =
51- grpcClient .qdrant ().healthCheck ( HealthCheckRequest .getDefaultInstance ()).get ();
50+ listCollectionsResponse =
51+ grpcClient .collections ().list ( ListCollectionsRequest .getDefaultInstance ()).get ();
5252 }
5353
54- assertNotNull (healthCheckReply .getTitle ());
55- assertNotNull (healthCheckReply .getVersion ());
54+ assertNotNull (listCollectionsResponse .getCollectionsList ());
5655 }
5756
5857 @ Test
@@ -61,7 +60,8 @@ public void client_without_api_key_cannot_connect() {
6160 ExecutionException executionException =
6261 assertThrows (
6362 ExecutionException .class ,
64- () -> grpcClient .qdrant ().healthCheck (HealthCheckRequest .getDefaultInstance ()).get ());
63+ () ->
64+ grpcClient .collections ().list (ListCollectionsRequest .getDefaultInstance ()).get ());
6565 Throwable cause = executionException .getCause ();
6666 assertEquals (StatusRuntimeException .class , cause .getClass ());
6767 StatusRuntimeException statusRuntimeException = (StatusRuntimeException ) cause ;
0 commit comments