16
16
17
17
package com.mongodb.async.client
18
18
19
-
20
19
import com.mongodb.MongoCompressor
21
20
import com.mongodb.MongoCredential
22
- import com.mongodb.MongoDriverInformation
23
21
import com.mongodb.ReadConcern
24
22
import com.mongodb.ServerAddress
25
23
import com.mongodb.WriteConcern
@@ -32,12 +30,8 @@ import static com.mongodb.ClusterFixture.connectionString
32
30
import static com.mongodb.ClusterFixture.getCredentialList
33
31
import static com.mongodb.ClusterFixture.getSslSettings
34
32
import static com.mongodb.ClusterFixture.isNotAtLeastJava8
35
- import static com.mongodb.ClusterFixture.isStandalone
36
- import static com.mongodb.ClusterFixture.serverVersionAtLeast
37
33
import static com.mongodb.ReadPreference.primary
38
34
import static com.mongodb.ReadPreference.secondaryPreferred
39
- import static com.mongodb.async.client.Fixture.getMongoClientBuilderFromConnectionString
40
- import static com.mongodb.async.client.TestHelper.run
41
35
import static java.util.concurrent.TimeUnit.MILLISECONDS
42
36
43
37
class MongoClientsSpecification extends FunctionalSpecification {
@@ -223,35 +217,4 @@ class MongoClientsSpecification extends FunctionalSpecification {
223
217
' mongodb://localhost/?compressors=zlib' | [MongoCompressor . createZlibCompressor()]
224
218
' mongodb://localhost/?compressors=zstd' | [MongoCompressor . createZstdCompressor()]
225
219
}
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
-
257
220
}
0 commit comments