1616
1717package com.mongodb.async.client
1818
19-
2019import com.mongodb.MongoCompressor
2120import com.mongodb.MongoCredential
22- import com.mongodb.MongoDriverInformation
2321import com.mongodb.ReadConcern
2422import com.mongodb.ServerAddress
2523import com.mongodb.WriteConcern
@@ -32,12 +30,8 @@ import static com.mongodb.ClusterFixture.connectionString
3230import static com.mongodb.ClusterFixture.getCredentialList
3331import static com.mongodb.ClusterFixture.getSslSettings
3432import static com.mongodb.ClusterFixture.isNotAtLeastJava8
35- import static com.mongodb.ClusterFixture.isStandalone
36- import static com.mongodb.ClusterFixture.serverVersionAtLeast
3733import static com.mongodb.ReadPreference.primary
3834import static com.mongodb.ReadPreference.secondaryPreferred
39- import static com.mongodb.async.client.Fixture.getMongoClientBuilderFromConnectionString
40- import static com.mongodb.async.client.TestHelper.run
4135import static java.util.concurrent.TimeUnit.MILLISECONDS
4236
4337class MongoClientsSpecification extends FunctionalSpecification {
@@ -223,35 +217,4 @@ class MongoClientsSpecification extends FunctionalSpecification {
223217 ' mongodb://localhost/?compressors=zlib' | [MongoCompressor . createZlibCompressor()]
224218 ' mongodb://localhost/?compressors=zstd' | [MongoCompressor . createZstdCompressor()]
225219 }
226-
227- @IgnoreIf ({ !serverVersionAtLeast(3 , 4 ) || !isStandalone() })
228- def ' application name should appear in the system.profile collection' () {
229- given :
230- def appName = ' appName1'
231- def driverInfo = MongoDriverInformation . builder(). driverName(' myDriver' ). driverVersion(' 42' ). build()
232- def client = MongoClients . create(getMongoClientBuilderFromConnectionString(). applicationName(appName). build(), driverInfo)
233- def database = client. getDatabase(getDatabaseName())
234- def collection = database. getCollection(getCollectionName())
235-
236- def profileCollection = database. getCollection(' system.profile' )
237- run(profileCollection. &drop)
238- run(database. &runCommand, new Document (' profile' , 2 ))
239-
240- when :
241- run(collection. &count)
242-
243- then :
244- Document profileDocument = run(profileCollection. find(). &first)
245- profileDocument. get(' appName' ) == appName
246-
247- cleanup :
248- if (database != null ) {
249- run(database. &runCommand, new Document (' profile' , 0 ))
250- }
251- if (profileCollection != null ) {
252- run(profileCollection. &drop)
253- }
254- client?. close()
255- }
256-
257220}
0 commit comments