@@ -38,23 +38,16 @@ public static void setup() {
38
38
db = DataAPIClients .astraDev ("<redacted>" ).getDatabase (UUID .fromString ("<redacted>" ));
39
39
}
40
40
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
+
48
42
49
43
@ Test
50
44
public void shouldCreateACollectionWithNvidia () {
51
- db .registerListener ("logger" , new LoggingCommandObserver (VectorizeITTest .class ));
52
-
53
45
Collection <Document > collection = db .createCollection (COLLECTION_VECTORIZE , CollectionOptions .builder ()
54
46
.withVectorDimension (NVIDIA_DIMENSION )
55
47
.withVectorSimilarityMetric (SimilarityMetric .cosine )
56
48
.withVectorize (NVIDIA_PROVIDER , NVIDIA_MODEL )
57
49
.build ());
50
+
58
51
assertThat (collection ).isNotNull ();
59
52
assertThat (db .listCollectionNames ().collect (Collectors .toList ())).contains (COLLECTION_VECTORIZE );
60
53
}
@@ -68,7 +61,6 @@ public void shouldInsertOneDocumentWithVectorize() {
68
61
InsertOneResult res = getCollectionVectorize ().insertOne (document );
69
62
assertThat (res ).isNotNull ();
70
63
assertThat (res .getInsertedId ()).isNotNull ();
71
- System .out .println (res .getInsertedId ());
72
64
}
73
65
74
66
@ Test
@@ -78,4 +70,13 @@ public void testFindVectorize() {
78
70
.forEach (doc -> System .out .println (doc .toJson ()));
79
71
}
80
72
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
+
81
82
}
0 commit comments