@@ -30,7 +30,7 @@ final class DeleteAPITests: XCTestCase {
30
30
}
31
31
32
32
func testBucketOrgParameters( ) {
33
- let expectation = self . expectation ( description: " Success response from API doesn't arrive " )
33
+ let expectation = XCTestExpectation ( description: " Success response from API doesn't arrive " )
34
34
expectation. expectedFulfillmentCount = 2
35
35
36
36
MockURLProtocol . handler = { request, _ in
@@ -53,11 +53,11 @@ final class DeleteAPITests: XCTestCase {
53
53
expectation. fulfill ( )
54
54
}
55
55
56
- waitForExpectations ( timeout : 1 , handler : nil )
56
+ wait ( for : [ expectation ] , timeout : 1 )
57
57
}
58
58
59
59
func testBucketIDOrgIDParameters( ) {
60
- let expectation = self . expectation ( description: " Success response from API doesn't arrive " )
60
+ let expectation = XCTestExpectation ( description: " Success response from API doesn't arrive " )
61
61
expectation. expectedFulfillmentCount = 2
62
62
63
63
MockURLProtocol . handler = { request, _ in
@@ -80,11 +80,11 @@ final class DeleteAPITests: XCTestCase {
80
80
expectation. fulfill ( )
81
81
}
82
82
83
- waitForExpectations ( timeout : 1 , handler : nil )
83
+ wait ( for : [ expectation ] , timeout : 1 )
84
84
}
85
85
86
86
func testWithoutBucketOrgParameters( ) {
87
- let expectation = self . expectation ( description: " Success response from API doesn't arrive " )
87
+ let expectation = XCTestExpectation ( description: " Success response from API doesn't arrive " )
88
88
expectation. expectedFulfillmentCount = 2
89
89
90
90
MockURLProtocol . handler = { request, _ in
@@ -106,11 +106,11 @@ final class DeleteAPITests: XCTestCase {
106
106
expectation. fulfill ( )
107
107
}
108
108
109
- waitForExpectations ( timeout : 1 , handler : nil )
109
+ wait ( for : [ expectation ] , timeout : 1 )
110
110
}
111
111
112
112
func testPredicateRequestSerialization( ) {
113
- let expectation = self . expectation ( description: " Success response from API doesn't arrive " )
113
+ let expectation = XCTestExpectation ( description: " Success response from API doesn't arrive " )
114
114
expectation. expectedFulfillmentCount = 2
115
115
116
116
MockURLProtocol . handler = { _, bodyData in
@@ -140,11 +140,11 @@ final class DeleteAPITests: XCTestCase {
140
140
expectation. fulfill ( )
141
141
}
142
142
143
- waitForExpectations ( timeout : 1 , handler : nil )
143
+ wait ( for : [ expectation ] , timeout : 1 )
144
144
}
145
145
146
146
func testErrorResponse( ) {
147
- let expectation = self . expectation ( description: " Success response from API doesn't arrive " )
147
+ let expectation = XCTestExpectation ( description: " Success response from API doesn't arrive " )
148
148
expectation. expectedFulfillmentCount = 2
149
149
150
150
MockURLProtocol . handler = { request, _ in
@@ -165,12 +165,12 @@ final class DeleteAPITests: XCTestCase {
165
165
expectation. fulfill ( )
166
166
}
167
167
168
- waitForExpectations ( timeout : 1 , handler : nil )
168
+ wait ( for : [ expectation ] , timeout : 1 )
169
169
}
170
170
171
171
#if swift(>=5.5)
172
172
func testDeleteAsync( ) async throws {
173
- let expectation = self . expectation ( description: " Success response from API doesn't arrive " )
173
+ let expectation = XCTestExpectation ( description: " Success response from API doesn't arrive " )
174
174
expectation. expectedFulfillmentCount = 1
175
175
176
176
MockURLProtocol . handler = { _, _ in
@@ -187,7 +187,7 @@ final class DeleteAPITests: XCTestCase {
187
187
188
188
try await client. deleteAPI. delete ( predicate: predicate)
189
189
190
- await waitForExpectations ( timeout : 1 , handler : nil )
190
+ await wait ( for : [ expectation ] , timeout : 1 )
191
191
}
192
192
#endif
193
193
}
0 commit comments