File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client
driver-scala/src/it/scala/org/mongodb/scala Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 31
31
import org .junit .After ;
32
32
import org .junit .Before ;
33
33
import org .junit .Test ;
34
- import static reactivestreams .helpers .SubscriberHelpers .ObservableSubscriber ;
35
- import static reactivestreams .helpers .SubscriberHelpers .OperationSubscriber ;
36
34
37
35
import java .security .SecureRandom ;
38
36
import java .util .HashMap ;
39
37
import java .util .Map ;
40
38
41
-
42
39
import static com .mongodb .ClusterFixture .serverVersionAtLeast ;
43
40
import static org .junit .Assert .assertEquals ;
44
41
import static org .junit .Assume .assumeTrue ;
42
+ import static reactivestreams .helpers .SubscriberHelpers .ObservableSubscriber ;
43
+ import static reactivestreams .helpers .SubscriberHelpers .OperationSubscriber ;
45
44
46
45
public class ClientSideEncryptionBypassAutoEncryptionTest {
47
46
private MongoClient clientEncrypted ;
@@ -117,5 +116,8 @@ public void after() throws Throwable {
117
116
Fixture .dropDatabase (Fixture .getDefaultDatabaseName ());
118
117
clientEncrypted .close ();
119
118
}
119
+ if (clientEncryption != null ) {
120
+ clientEncryption .close ();
121
+ }
120
122
}
121
123
}
Original file line number Diff line number Diff line change 25
25
import com .mongodb .reactivestreams .client .syncadapter .SyncMongoClient ;
26
26
import org .bson .BsonArray ;
27
27
import org .bson .BsonDocument ;
28
+ import org .junit .After ;
28
29
29
30
public class ClientSideEncryptionTest extends AbstractClientSideEncryptionTest {
30
31
@@ -49,4 +50,11 @@ protected void createMongoClient(final AutoEncryptionSettings autoEncryptionSett
49
50
protected MongoDatabase getDatabase (final String databaseName ) {
50
51
return mongoClient .getDatabase (databaseName );
51
52
}
53
+
54
+ @ After
55
+ public void cleanUp () {
56
+ if (mongoClient != null ) {
57
+ mongoClient .close ();
58
+ }
59
+ }
52
60
}
Original file line number Diff line number Diff line change 16
16
17
17
package org .mongodb .scala
18
18
19
- import com .mongodb .client .{ AbstractClientSideEncryptionTest , Fixture }
19
+ import com .mongodb .client .{AbstractClientSideEncryptionTest , Fixture }
20
20
import com .mongodb .event .CommandListener
21
+ import org .bson .{BsonArray , BsonDocument }
22
+ import org .junit .After
21
23
import org .mongodb .scala .syncadapter .SyncMongoClient
22
- import org .bson .BsonArray
23
- import org .bson .BsonDocument
24
24
25
25
class ClientSideEncryptionTest (
26
26
val filename : String ,
@@ -48,4 +48,9 @@ class ClientSideEncryptionTest(
48
48
49
49
override protected def getDatabase (databaseName : String ): com.mongodb.client.MongoDatabase =
50
50
mongoClient.getDatabase(databaseName)
51
+
52
+ @ After
53
+ def cleanUp (): Unit = {
54
+ if (mongoClient != null ) mongoClient.close()
55
+ }
51
56
}
You can’t perform that action at this time.
0 commit comments