Skip to content

Commit 490b332

Browse files
committed
vectorize:
1 parent bc97df3 commit 490b332

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

astra-db-java/src/test/java/com/datastax/astra/test/integration/collection/VectorizeITTest.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,16 @@ public static void setup() {
3838
db = DataAPIClients.astraDev("<redacted>").getDatabase(UUID.fromString("<redacted>"));
3939
}
4040

41-
private Collection<Document> getCollectionVectorize() {
42-
if (collectionVectorize == null) {
43-
collectionVectorize = db.getCollection(COLLECTION_VECTORIZE);
44-
collectionVectorize.registerListener("logger", new LoggingCommandObserver(VectorizeITTest.class));
45-
}
46-
return collectionVectorize;
47-
}
41+
4842

4943
@Test
5044
public void shouldCreateACollectionWithNvidia() {
51-
db.registerListener("logger", new LoggingCommandObserver(VectorizeITTest.class));
52-
5345
Collection<Document> collection = db.createCollection(COLLECTION_VECTORIZE, CollectionOptions.builder()
5446
.withVectorDimension(NVIDIA_DIMENSION)
5547
.withVectorSimilarityMetric(SimilarityMetric.cosine)
5648
.withVectorize(NVIDIA_PROVIDER, NVIDIA_MODEL)
5749
.build());
50+
5851
assertThat(collection).isNotNull();
5952
assertThat(db.listCollectionNames().collect(Collectors.toList())).contains(COLLECTION_VECTORIZE);
6053
}
@@ -68,7 +61,6 @@ public void shouldInsertOneDocumentWithVectorize() {
6861
InsertOneResult res = getCollectionVectorize().insertOne(document);
6962
assertThat(res).isNotNull();
7063
assertThat(res.getInsertedId()).isNotNull();
71-
System.out.println(res.getInsertedId());
7264
}
7365

7466
@Test
@@ -78,4 +70,13 @@ public void testFindVectorize() {
7870
.forEach(doc -> System.out.println(doc.toJson()));
7971
}
8072

73+
74+
private Collection<Document> getCollectionVectorize() {
75+
if (collectionVectorize == null) {
76+
collectionVectorize = db.getCollection(COLLECTION_VECTORIZE);
77+
collectionVectorize.registerListener("logger", new LoggingCommandObserver(VectorizeITTest.class));
78+
}
79+
return collectionVectorize;
80+
}
81+
8182
}

0 commit comments

Comments
 (0)