@@ -76,11 +76,10 @@ final class RequestBagTests: XCTestCase {
76
76
eventLoop: embeddedEventLoop
77
77
)
78
78
79
- executor. runRequest ( bag)
80
-
81
79
XCTAssertEqual ( delegate. hitDidSendRequestHead, 0 )
82
- bag . requestHeadSent ( )
80
+ executor . runRequest ( bag )
83
81
XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
82
+
84
83
streamIsAllowedToWrite = true
85
84
bag. resumeRequestBodyStream ( )
86
85
streamIsAllowedToWrite = false
@@ -180,10 +179,8 @@ final class RequestBagTests: XCTestCase {
180
179
181
180
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
182
181
183
- bag. willExecuteRequest ( executor)
184
-
185
182
XCTAssertEqual ( delegate. hitDidSendRequestHead, 0 )
186
- bag . requestHeadSent ( )
183
+ executor . runRequest ( bag )
187
184
XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
188
185
XCTAssertEqual ( delegate. hitDidSendRequestPart, 0 )
189
186
bag. resumeRequestBodyStream ( )
@@ -256,12 +253,11 @@ final class RequestBagTests: XCTestCase {
256
253
257
254
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
258
255
259
- bag. willExecuteRequest ( executor)
260
256
XCTAssertFalse ( executor. isCancelled)
261
257
262
258
XCTAssertEqual ( delegate. hitDidSendRequestHead, 0 )
263
259
XCTAssertEqual ( delegate. hitDidSendRequest, 0 )
264
- bag . requestHeadSent ( )
260
+ executor . runRequest ( bag )
265
261
XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
266
262
XCTAssertEqual ( delegate. hitDidSendRequest, 1 )
267
263
@@ -330,8 +326,7 @@ final class RequestBagTests: XCTestCase {
330
326
guard let bag = maybeRequestBag else { return XCTFail ( " Expected to be able to create a request bag. " ) }
331
327
332
328
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
333
- bag. willExecuteRequest ( executor)
334
- bag. requestHeadSent ( )
329
+ executor. runRequest ( bag)
335
330
bag. receiveResponseHead ( . init( version: . http1_1, status: . ok) )
336
331
XCTAssertEqual ( executor. isCancelled, false )
337
332
bag. fail ( HTTPClientError . readTimeout)
@@ -387,11 +382,10 @@ final class RequestBagTests: XCTestCase {
387
382
guard let bag = maybeRequestBag else { return XCTFail ( " Expected to be able to create a request bag. " ) }
388
383
389
384
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
390
- bag. willExecuteRequest ( executor)
391
385
392
386
XCTAssertEqual ( delegate. hitDidSendRequestHead, 0 )
393
387
XCTAssertEqual ( delegate. hitDidSendRequest, 0 )
394
- bag . requestHeadSent ( )
388
+ executor . runRequest ( bag )
395
389
XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
396
390
XCTAssertEqual ( delegate. hitDidSendRequest, 0 )
397
391
@@ -432,8 +426,7 @@ final class RequestBagTests: XCTestCase {
432
426
guard let bag = maybeRequestBag else { return XCTFail ( " Expected to be able to create a request bag. " ) }
433
427
434
428
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
435
- bag. willExecuteRequest ( executor)
436
- bag. requestHeadSent ( )
429
+ executor. runRequest ( bag)
437
430
bag. receiveResponseHead ( . init( version: . http1_1, status: . ok) )
438
431
XCTAssertFalse ( executor. signalledDemandForResponseBody)
439
432
XCTAssertNoThrow ( try XCTUnwrap ( delegate. backpressurePromise) . succeed ( ( ) ) )
0 commit comments