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 3131import org .junit .After ;
3232import org .junit .Before ;
3333import org .junit .Test ;
34- import static reactivestreams .helpers .SubscriberHelpers .ObservableSubscriber ;
35- import static reactivestreams .helpers .SubscriberHelpers .OperationSubscriber ;
3634
3735import java .security .SecureRandom ;
3836import java .util .HashMap ;
3937import java .util .Map ;
4038
41-
4239import static com .mongodb .ClusterFixture .serverVersionAtLeast ;
4340import static org .junit .Assert .assertEquals ;
4441import static org .junit .Assume .assumeTrue ;
42+ import static reactivestreams .helpers .SubscriberHelpers .ObservableSubscriber ;
43+ import static reactivestreams .helpers .SubscriberHelpers .OperationSubscriber ;
4544
4645public class ClientSideEncryptionBypassAutoEncryptionTest {
4746 private MongoClient clientEncrypted ;
@@ -117,5 +116,8 @@ public void after() throws Throwable {
117116 Fixture .dropDatabase (Fixture .getDefaultDatabaseName ());
118117 clientEncrypted .close ();
119118 }
119+ if (clientEncryption != null ) {
120+ clientEncryption .close ();
121+ }
120122 }
121123}
Original file line number Diff line number Diff line change 2525import com .mongodb .reactivestreams .client .syncadapter .SyncMongoClient ;
2626import org .bson .BsonArray ;
2727import org .bson .BsonDocument ;
28+ import org .junit .After ;
2829
2930public class ClientSideEncryptionTest extends AbstractClientSideEncryptionTest {
3031
@@ -49,4 +50,11 @@ protected void createMongoClient(final AutoEncryptionSettings autoEncryptionSett
4950 protected MongoDatabase getDatabase (final String databaseName ) {
5051 return mongoClient .getDatabase (databaseName );
5152 }
53+
54+ @ After
55+ public void cleanUp () {
56+ if (mongoClient != null ) {
57+ mongoClient .close ();
58+ }
59+ }
5260}
Original file line number Diff line number Diff line change 1616
1717package org .mongodb .scala
1818
19- import com .mongodb .client .{ AbstractClientSideEncryptionTest , Fixture }
19+ import com .mongodb .client .{AbstractClientSideEncryptionTest , Fixture }
2020import com .mongodb .event .CommandListener
21+ import org .bson .{BsonArray , BsonDocument }
22+ import org .junit .After
2123import org .mongodb .scala .syncadapter .SyncMongoClient
22- import org .bson .BsonArray
23- import org .bson .BsonDocument
2424
2525class ClientSideEncryptionTest (
2626 val filename : String ,
@@ -48,4 +48,9 @@ class ClientSideEncryptionTest(
4848
4949 override protected def getDatabase (databaseName : String ): com.mongodb.client.MongoDatabase =
5050 mongoClient.getDatabase(databaseName)
51+
52+ @ After
53+ def cleanUp (): Unit = {
54+ if (mongoClient != null ) mongoClient.close()
55+ }
5156}
You can’t perform that action at this time.
0 commit comments