@@ -108,7 +108,7 @@ public void createsCollectionWithEncryptedFieldsCorrectly(CollectionOptions coll
108108 .containsEntry ("queries" , List .of (Document .parse (
109109 "{'queryType': 'range', 'contention': { '$numberLong' : '0' }, 'min': { '$numberLong' : '-1' }, 'max': { '$numberLong' : '1' }}" )));
110110
111- assertThat (fields .get (2 )).containsEntry ("path" , "encryptedDouble" ) //
111+ assertThat (fields .get (3 )).containsEntry ("path" , "encryptedDouble" ) //
112112 .containsEntry ("bsonType" , "double" ) //
113113 .containsEntry ("queries" , List .of (Document .parse (
114114 "{'queryType': 'range', 'contention': { '$numberLong' : '1' }, 'min': { '$numberDouble' : '-1.123' }, 'max': { '$numberDouble' : '1.123' }, 'precision': { '$numberInt' : '5'}}" )));
@@ -119,13 +119,14 @@ private static Stream<Arguments> collectionOptions() {
119119 BsonBinary key1 = new BsonBinary (UUID .randomUUID (), UuidRepresentation .STANDARD );
120120 BsonBinary key2 = new BsonBinary (UUID .randomUUID (), UuidRepresentation .STANDARD );
121121 BsonBinary key3 = new BsonBinary (UUID .randomUUID (), UuidRepresentation .STANDARD );
122+ BsonBinary key4 = new BsonBinary (UUID .randomUUID (), UuidRepresentation .STANDARD );
122123
123124 CollectionOptions manualOptions = CollectionOptions .encryptedCollection (options -> options //
124125 .encrypted (int32 ("encrypted-but-not-queryable" ), key1 ) //
125126 .queryable (encrypted (int32 ("encryptedInt" )).keyId (key2 ), range ().min (5 ).max (100 ).contention (1 )) //
126127 .queryable (encrypted (JsonSchemaProperty .int64 ("nested.encryptedLong" )).keyId (key3 ),
127128 range ().min (-1L ).max (1L ).contention (0 )) //
128- .queryable (encrypted (JsonSchemaProperty .float64 ("encryptedDouble" )).keys (key3 ),
129+ .queryable (encrypted (JsonSchemaProperty .float64 ("encryptedDouble" )).keys (key4 ),
129130 range ().min (-1.123D ).max (1.123D ).precision (5 ).contention (1 )));
130131
131132 CollectionOptions schemaOptions = CollectionOptions .encryptedCollection (MongoJsonSchema .builder () //
@@ -134,7 +135,7 @@ private static Stream<Arguments> collectionOptions() {
134135 queryable (encrypted (int32 ("encryptedInt" )).keyId (key2 ), List .of (range ().min (5 ).max (100 ).contention (1 ))))
135136 .property (queryable (encrypted (int64 ("nested.encryptedLong" )).keyId (key3 ),
136137 List .of (range ().min (-1L ).max (1L ).contention (0 ))))
137- .property (queryable (encrypted (float64 ("encryptedDouble" )).keyId (key3 ),
138+ .property (queryable (encrypted (float64 ("encryptedDouble" )).keyId (key4 ),
138139 List .of (range ().min (-1.123D ).max (1.123D ).precision (5 ).contention (1 ))))
139140 .build ());
140141
0 commit comments