@@ -4,7 +4,7 @@ use crate::{
4
4
bson:: { doc, Bson , Document } ,
5
5
error:: ErrorKind ,
6
6
options:: { Acknowledgment , ReadConcern , WriteConcern } ,
7
- test:: { EventClient , TestClient } ,
7
+ test:: EventClient ,
8
8
Client ,
9
9
Collection ,
10
10
} ;
@@ -92,7 +92,7 @@ fn write_concern_deserialize() {
92
92
#[ tokio:: test]
93
93
#[ function_name:: named]
94
94
async fn inconsistent_write_concern_rejected ( ) {
95
- let client = TestClient :: new ( ) . await ;
95
+ let client = Client :: for_test ( ) . await ;
96
96
let db = client. database ( function_name ! ( ) ) ;
97
97
98
98
let coll = db. collection ( function_name ! ( ) ) ;
@@ -112,7 +112,7 @@ async fn inconsistent_write_concern_rejected() {
112
112
#[ tokio:: test]
113
113
#[ function_name:: named]
114
114
async fn unacknowledged_write_concern_rejected ( ) {
115
- let client = TestClient :: new ( ) . await ;
115
+ let client = Client :: for_test ( ) . await ;
116
116
let db = client. database ( function_name ! ( ) ) ;
117
117
let coll = db. collection ( function_name ! ( ) ) ;
118
118
let wc = WriteConcern {
@@ -131,7 +131,7 @@ async fn unacknowledged_write_concern_rejected() {
131
131
#[ tokio:: test]
132
132
#[ function_name:: named]
133
133
async fn snapshot_read_concern ( ) {
134
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
134
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
135
135
// snapshot read concern was introduced in 4.0
136
136
if client. server_version_lt ( 4 , 0 ) {
137
137
return ;
@@ -186,7 +186,7 @@ async fn assert_event_contains_read_concern(client: &EventClient) {
186
186
#[ tokio:: test]
187
187
#[ function_name:: named]
188
188
async fn command_contains_write_concern_insert_one ( ) {
189
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
189
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
190
190
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
191
191
192
192
coll. drop ( ) . await . unwrap ( ) ;
@@ -227,7 +227,7 @@ async fn command_contains_write_concern_insert_one() {
227
227
#[ tokio:: test]
228
228
#[ function_name:: named]
229
229
async fn command_contains_write_concern_insert_many ( ) {
230
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
230
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
231
231
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
232
232
233
233
coll. drop ( ) . await . unwrap ( ) ;
@@ -268,7 +268,7 @@ async fn command_contains_write_concern_insert_many() {
268
268
#[ tokio:: test]
269
269
#[ function_name:: named]
270
270
async fn command_contains_write_concern_update_one ( ) {
271
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
271
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
272
272
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
273
273
274
274
coll. drop ( ) . await . unwrap ( ) ;
@@ -310,7 +310,7 @@ async fn command_contains_write_concern_update_one() {
310
310
#[ tokio:: test]
311
311
#[ function_name:: named]
312
312
async fn command_contains_write_concern_update_many ( ) {
313
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
313
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
314
314
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
315
315
316
316
coll. drop ( ) . await . unwrap ( ) ;
@@ -354,7 +354,7 @@ async fn command_contains_write_concern_update_many() {
354
354
#[ tokio:: test]
355
355
#[ function_name:: named]
356
356
async fn command_contains_write_concern_replace_one ( ) {
357
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
357
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
358
358
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
359
359
360
360
coll. drop ( ) . await . unwrap ( ) ;
@@ -396,7 +396,7 @@ async fn command_contains_write_concern_replace_one() {
396
396
#[ tokio:: test]
397
397
#[ function_name:: named]
398
398
async fn command_contains_write_concern_delete_one ( ) {
399
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
399
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
400
400
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
401
401
402
402
coll. drop ( ) . await . unwrap ( ) ;
@@ -440,7 +440,7 @@ async fn command_contains_write_concern_delete_one() {
440
440
#[ tokio:: test]
441
441
#[ function_name:: named]
442
442
async fn command_contains_write_concern_delete_many ( ) {
443
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
443
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
444
444
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
445
445
446
446
coll. drop ( ) . await . unwrap ( ) ;
@@ -487,7 +487,7 @@ async fn command_contains_write_concern_delete_many() {
487
487
#[ tokio:: test]
488
488
#[ function_name:: named]
489
489
async fn command_contains_write_concern_find_one_and_delete ( ) {
490
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
490
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
491
491
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
492
492
493
493
coll. drop ( ) . await . unwrap ( ) ;
@@ -531,7 +531,7 @@ async fn command_contains_write_concern_find_one_and_delete() {
531
531
#[ tokio:: test]
532
532
#[ function_name:: named]
533
533
async fn command_contains_write_concern_find_one_and_replace ( ) {
534
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
534
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
535
535
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
536
536
537
537
coll. drop ( ) . await . unwrap ( ) ;
@@ -575,7 +575,7 @@ async fn command_contains_write_concern_find_one_and_replace() {
575
575
#[ tokio:: test]
576
576
#[ function_name:: named]
577
577
async fn command_contains_write_concern_find_one_and_update ( ) {
578
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
578
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
579
579
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
580
580
581
581
coll. drop ( ) . await . unwrap ( ) ;
@@ -619,7 +619,7 @@ async fn command_contains_write_concern_find_one_and_update() {
619
619
#[ tokio:: test]
620
620
#[ function_name:: named]
621
621
async fn command_contains_write_concern_aggregate ( ) {
622
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
622
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
623
623
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
624
624
625
625
coll. drop ( ) . await . unwrap ( ) ;
@@ -669,7 +669,7 @@ async fn command_contains_write_concern_aggregate() {
669
669
#[ tokio:: test]
670
670
#[ function_name:: named]
671
671
async fn command_contains_write_concern_drop ( ) {
672
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
672
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
673
673
let coll: Collection < Document > = client. database ( "test" ) . collection ( function_name ! ( ) ) ;
674
674
675
675
coll. drop ( ) . await . unwrap ( ) ;
@@ -715,7 +715,7 @@ async fn command_contains_write_concern_drop() {
715
715
#[ tokio:: test]
716
716
#[ function_name:: named]
717
717
async fn command_contains_write_concern_create_collection ( ) {
718
- let client = Client :: test_builder ( ) . monitor_events ( ) . build ( ) . await ;
718
+ let client = Client :: for_test ( ) . monitor_events ( ) . await ;
719
719
let db = client. database ( "test" ) ;
720
720
let coll: Collection < Document > = db. collection ( function_name ! ( ) ) ;
721
721
0 commit comments