@@ -230,7 +230,7 @@ class HTTPClientTests: XCTestCase {
230
230
}
231
231
232
232
func testMultipleContentLengthHeaders( ) throws {
233
- let body = ByteBuffer . of ( string: " hello world! " )
233
+ let body = ByteBuffer ( string: " hello world! " )
234
234
235
235
var headers = HTTPHeaders ( )
236
236
headers. add ( name: " Content-Length " , value: " 12 " )
@@ -392,9 +392,9 @@ class HTTPClientTests: XCTestCase {
392
392
393
393
func testUploadStreaming( ) throws {
394
394
let body : HTTPClient . Body = . stream( length: 8 ) { writer in
395
- let buffer = ByteBuffer . of ( string: " 1234 " )
395
+ let buffer = ByteBuffer ( string: " 1234 " )
396
396
return writer. write ( . byteBuffer( buffer) ) . flatMap {
397
- let buffer = ByteBuffer . of ( string: " 4321 " )
397
+ let buffer = ByteBuffer ( string: " 4321 " )
398
398
return writer. write ( . byteBuffer( buffer) )
399
399
}
400
400
}
@@ -651,7 +651,7 @@ class HTTPClientTests: XCTestCase {
651
651
}
652
652
653
653
var request = try HTTPClient . Request ( url: " http://localhost: \( localHTTPBin. port) /post " , method: . POST)
654
- request. body = . byteBuffer( ByteBuffer . of ( bytes: [ 120 , 156 , 75 , 76 , 28 , 5 , 200 , 0 , 0 , 248 , 66 , 103 , 17 ] ) )
654
+ request. body = . byteBuffer( ByteBuffer ( bytes: [ 120 , 156 , 75 , 76 , 28 , 5 , 200 , 0 , 0 , 248 , 66 , 103 , 17 ] ) )
655
655
request. headers. add ( name: " Accept-Encoding " , value: " deflate " )
656
656
657
657
XCTAssertThrowsError ( try localClient. execute ( request: request) . wait ( ) ) { error in
@@ -1682,7 +1682,7 @@ class HTTPClientTests: XCTestCase {
1682
1682
let promise = self . defaultClient. eventLoopGroup. next ( ) . makePromise ( of: Void . self)
1683
1683
// We have to toleare callins from any thread
1684
1684
DispatchQueue ( label: " upload-streaming " ) . async {
1685
- writer. write ( . byteBuffer( ByteBuffer . of ( string: " 1234 " ) ) ) . whenComplete { _ in
1685
+ writer. write ( . byteBuffer( ByteBuffer ( string: " 1234 " ) ) ) . whenComplete { _ in
1686
1686
promise. succeed ( ( ) )
1687
1687
}
1688
1688
}
@@ -2049,7 +2049,7 @@ class HTTPClientTests: XCTestCase {
2049
2049
XCTAssertNoThrow ( try httpServer. readInbound ( ) ) // .end
2050
2050
2051
2051
XCTAssertNoThrow ( try httpServer. writeOutbound ( . head( . init( version: . init( major: 1 , minor: 1 ) , status: . ok) ) ) )
2052
- XCTAssertNoThrow ( try httpServer. writeOutbound ( . body( . byteBuffer( ByteBuffer . of ( string: " 1234 " ) ) ) ) )
2052
+ XCTAssertNoThrow ( try httpServer. writeOutbound ( . body( . byteBuffer( ByteBuffer ( string: " 1234 " ) ) ) ) )
2053
2053
XCTAssertNoThrow ( try httpServer. writeOutbound ( . end( nil ) ) )
2054
2054
2055
2055
XCTAssertNoThrow ( try future. wait ( ) )
@@ -2066,7 +2066,7 @@ class HTTPClientTests: XCTestCase {
2066
2066
streamWriter. write ( . byteBuffer( ByteBuffer ( string: " 1 " ) ) ) . cascade ( to: promise)
2067
2067
}
2068
2068
return promise. futureResult
2069
- } ) ) . wait ( ) ) { error in
2069
+ } ) ) . wait ( ) ) { error in
2070
2070
XCTAssertEqual ( error as! HTTPClientError , HTTPClientError . bodyLengthMismatch)
2071
2071
}
2072
2072
// Quickly try another request and check that it works.
@@ -2092,7 +2092,7 @@ class HTTPClientTests: XCTestCase {
2092
2092
Request ( url: url,
2093
2093
body: . stream( length: 1 ) { streamWriter in
2094
2094
streamWriter. write ( . byteBuffer( ByteBuffer ( string: tooLong) ) )
2095
- } ) ) . wait ( ) ) { error in
2095
+ } ) ) . wait ( ) ) { error in
2096
2096
XCTAssertEqual ( error as! HTTPClientError , HTTPClientError . bodyLengthMismatch)
2097
2097
}
2098
2098
// Quickly try another request and check that it works. If we by accident wrote some extra bytes into the
0 commit comments