@@ -45,6 +45,7 @@ public void testSyncListEndpoint() throws InterruptedException {
4545
4646 // Confirm all vector IDs from custom namespace are returned when pass customNamespace
4747 ListResponse listResponseCustomNamespace = indexConnection .list (customNamespace );
48+ assertEquals (listResponseCustomNamespace .getVectorsList ().size (), 4 );
4849 assertTrue (listResponseCustomNamespace .getVectorsList ().toString ().contains ("cus-id1" ));
4950 assertTrue (listResponseCustomNamespace .getVectorsList ().toString ().contains ("cus-id2" ));
5051 assertTrue (listResponseCustomNamespace .getVectorsList ().toString ().contains ("cus-prefix-id3" ));
@@ -59,6 +60,23 @@ public void testSyncListEndpoint() throws InterruptedException {
5960 // Confirm all vector IDs from custom namespace are returned when limit is specified
6061 ListResponse listResponseWithLimit = indexConnection .list (customNamespace , 1 );
6162 assertEquals (1 , listResponseWithLimit .getVectorsList ().size ());
63+
64+ // Confirm all vector IDs from custom namespace are returned using pagination
65+ ListResponse listResponseWithPaginationNoPrefix1 = indexConnection .list (customNamespace , 2 );
66+ assertEquals (listResponseWithPaginationNoPrefix1 .getVectorsList ().size (), 2 );
67+ ListResponse listResponseWithPaginationNoPrefix2 = indexConnection .list (
68+ customNamespace ,
69+ 2 ,
70+ listResponseWithPaginationNoPrefix1 .getPagination ().getNext ()
71+ );
72+ assertEquals (listResponseWithPaginationNoPrefix2 .getVectorsList ().size (), 2 );
73+ ListResponse listResponseWithPaginationNoPrefix3 = indexConnection .list (
74+ customNamespace ,
75+ 2 ,
76+ listResponseWithPaginationNoPrefix2 .getPagination ().getNext ()
77+ );
78+ assertEquals (listResponseWithPaginationNoPrefix3 .getVectorsList ().size (), 0 );
79+ assertEquals (listResponseWithPaginationNoPrefix3 .getPagination ().getNext (), "" );
6280 }
6381
6482 @ Test
@@ -92,6 +110,26 @@ public void testAsyncListEndpoint() throws InterruptedException {
92110 ListenableFuture <ListResponse > futureResponseWithLimit = asyncIndexConnection .list (customNamespace , 1 );
93111 ListResponse asyncListResponseWithLimit = Futures .getUnchecked (futureResponseWithLimit );
94112 assertEquals (1 , asyncListResponseWithLimit .getVectorsList ().size ());
113+
114+ // Confirm all vector IDs from custom namespace are returned using pagination
115+ ListenableFuture <ListResponse > futureResponseWithPaginationNoPrefix1 = asyncIndexConnection .list (customNamespace , 2 );
116+ ListResponse asyncListResponseWithPaginationNoPrefix1 = Futures .getUnchecked (futureResponseWithPaginationNoPrefix1 );
117+ assertEquals (asyncListResponseWithPaginationNoPrefix1 .getVectorsList ().size (), 2 );
118+ ListenableFuture <ListResponse > futureResponseWithPaginationNoPrefix2 = asyncIndexConnection .list (
119+ customNamespace ,
120+ 2 ,
121+ asyncListResponseWithPaginationNoPrefix1 .getPagination ().getNext ()
122+ );
123+ ListResponse asyncListResponseWithPaginationNoPrefix2 = Futures .getUnchecked (futureResponseWithPaginationNoPrefix2 );
124+ assertEquals (asyncListResponseWithPaginationNoPrefix2 .getVectorsList ().size (), 2 );
125+ ListenableFuture <ListResponse > futureResponseWithPaginationNoPrefix3 = asyncIndexConnection .list (
126+ customNamespace ,
127+ 2 ,
128+ asyncListResponseWithPaginationNoPrefix2 .getPagination ().getNext ()
129+ );
130+ ListResponse asyncListResponseWithPaginationNoPrefix3 = Futures .getUnchecked (futureResponseWithPaginationNoPrefix3 );
131+ assertEquals (asyncListResponseWithPaginationNoPrefix3 .getVectorsList ().size (), 0 );
132+ assertEquals (asyncListResponseWithPaginationNoPrefix3 .getPagination ().getNext (), "" );
95133 }
96134
97135}
0 commit comments