16
16
17
17
package com.mongodb
18
18
19
-
19
+ import org.bson.UuidRepresentation
20
20
import spock.lang.IgnoreIf
21
21
import spock.lang.Specification
22
22
import spock.lang.Unroll
@@ -140,6 +140,7 @@ class MongoClientURISpecification extends Specification {
140
140
+ ' heartbeatFrequencyMS=20000&'
141
141
+ ' retryWrites=true&'
142
142
+ ' retryReads=true&'
143
+ + ' uuidRepresentation=csharpLegacy&'
143
144
+ ' appName=app1' )
144
145
145
146
when :
@@ -164,6 +165,7 @@ class MongoClientURISpecification extends Specification {
164
165
options. getHeartbeatFrequency() == 20000
165
166
options. getRetryWrites()
166
167
options. getRetryReads()
168
+ options. getUuidRepresentation() == UuidRepresentation . C_SHARP_LEGACY
167
169
options. getApplicationName() == ' app1'
168
170
}
169
171
@@ -183,6 +185,7 @@ class MongoClientURISpecification extends Specification {
183
185
! options. isSslEnabled()
184
186
options. getRetryWrites()
185
187
options. getRetryReads()
188
+ options. getUuidRepresentation() == UuidRepresentation . JAVA_LEGACY
186
189
}
187
190
188
191
def ' should apply default uri to options' () {
@@ -214,6 +217,7 @@ class MongoClientURISpecification extends Specification {
214
217
.localThreshold(25 )
215
218
.requiredReplicaSetName(' test' )
216
219
.compressorList([MongoCompressor . createZlibCompressor()])
220
+ .uuidRepresentation(UuidRepresentation . C_SHARP_LEGACY )
217
221
218
222
when :
219
223
def options = new MongoClientURI (' mongodb://localhost' , optionsBuilder). getOptions()
@@ -246,6 +250,7 @@ class MongoClientURISpecification extends Specification {
246
250
options. getServerSettings(). getHeartbeatFrequency(MILLISECONDS ) == 5
247
251
options. getServerSettings(). getMinHeartbeatFrequency(MILLISECONDS ) == 11
248
252
options. compressorList == [MongoCompressor . createZlibCompressor()]
253
+ options. getUuidRepresentation() == UuidRepresentation . C_SHARP_LEGACY
249
254
}
250
255
251
256
@Unroll
0 commit comments