16
16
17
17
package com.mongodb
18
18
19
+ import org.bson.UuidRepresentation
19
20
import spock.lang.Specification
20
21
import spock.lang.Unroll
21
22
@@ -137,6 +138,7 @@ class MongoClientURISpecification extends Specification {
137
138
+ ' heartbeatFrequencyMS=20000&'
138
139
+ ' retryWrites=true&'
139
140
+ ' retryReads=true&'
141
+ + ' uuidRepresentation=csharpLegacy&'
140
142
+ ' appName=app1' )
141
143
142
144
when :
@@ -160,6 +162,7 @@ class MongoClientURISpecification extends Specification {
160
162
options. getHeartbeatFrequency() == 20000
161
163
options. getRetryWrites()
162
164
options. getRetryReads()
165
+ options. getUuidRepresentation() == UuidRepresentation . C_SHARP_LEGACY
163
166
options. getApplicationName() == ' app1'
164
167
}
165
168
@@ -177,6 +180,7 @@ class MongoClientURISpecification extends Specification {
177
180
! options. isSslEnabled()
178
181
options. getRetryWrites()
179
182
options. getRetryReads()
183
+ options. getUuidRepresentation() == UuidRepresentation . UNSPECIFIED
180
184
}
181
185
182
186
def ' should apply default uri to options' () {
@@ -205,6 +209,7 @@ class MongoClientURISpecification extends Specification {
205
209
.localThreshold(25 )
206
210
.requiredReplicaSetName(' test' )
207
211
.compressorList([MongoCompressor . createZlibCompressor()])
212
+ .uuidRepresentation(UuidRepresentation . C_SHARP_LEGACY )
208
213
209
214
when :
210
215
def options = new MongoClientURI (' mongodb://localhost' , optionsBuilder). getOptions()
@@ -234,6 +239,7 @@ class MongoClientURISpecification extends Specification {
234
239
options. getServerSettings(). getHeartbeatFrequency(MILLISECONDS ) == 5
235
240
options. getServerSettings(). getMinHeartbeatFrequency(MILLISECONDS ) == 11
236
241
options. compressorList == [MongoCompressor . createZlibCompressor()]
242
+ options. getUuidRepresentation() == UuidRepresentation . C_SHARP_LEGACY
237
243
}
238
244
239
245
@Unroll
0 commit comments