1616
1717package com.mongodb
1818
19+ import org.bson.UuidRepresentation
1920import spock.lang.Specification
2021import spock.lang.Unroll
2122
@@ -137,6 +138,7 @@ class MongoClientURISpecification extends Specification {
137138 + ' heartbeatFrequencyMS=20000&'
138139 + ' retryWrites=true&'
139140 + ' retryReads=true&'
141+ + ' uuidRepresentation=csharpLegacy&'
140142 + ' appName=app1' )
141143
142144 when :
@@ -160,6 +162,7 @@ class MongoClientURISpecification extends Specification {
160162 options. getHeartbeatFrequency() == 20000
161163 options. getRetryWrites()
162164 options. getRetryReads()
165+ options. getUuidRepresentation() == UuidRepresentation . C_SHARP_LEGACY
163166 options. getApplicationName() == ' app1'
164167 }
165168
@@ -177,6 +180,7 @@ class MongoClientURISpecification extends Specification {
177180 ! options. isSslEnabled()
178181 options. getRetryWrites()
179182 options. getRetryReads()
183+ options. getUuidRepresentation() == UuidRepresentation . UNSPECIFIED
180184 }
181185
182186 def ' should apply default uri to options' () {
@@ -205,6 +209,7 @@ class MongoClientURISpecification extends Specification {
205209 .localThreshold(25 )
206210 .requiredReplicaSetName(' test' )
207211 .compressorList([MongoCompressor . createZlibCompressor()])
212+ .uuidRepresentation(UuidRepresentation . C_SHARP_LEGACY )
208213
209214 when :
210215 def options = new MongoClientURI (' mongodb://localhost' , optionsBuilder). getOptions()
@@ -234,6 +239,7 @@ class MongoClientURISpecification extends Specification {
234239 options. getServerSettings(). getHeartbeatFrequency(MILLISECONDS ) == 5
235240 options. getServerSettings(). getMinHeartbeatFrequency(MILLISECONDS ) == 11
236241 options. compressorList == [MongoCompressor . createZlibCompressor()]
242+ options. getUuidRepresentation() == UuidRepresentation . C_SHARP_LEGACY
237243 }
238244
239245 @Unroll
0 commit comments