@@ -26,7 +26,7 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
26
26
let socketAddress = try ! SocketAddress . makeAddressResolvingHost ( " localhost " , port: 0 )
27
27
XCTAssertNoThrow ( try embedded. connect ( to: socketAddress) . wait ( ) )
28
28
29
- let proxyConnectHandler = HTTP1ProxyConnectHandler (
29
+ let proxyConnectHandler = NIOHTTP1ProxyConnectHandler (
30
30
targetHost: " swift.org " ,
31
31
targetPort: 443 ,
32
32
headers: [ : ] ,
@@ -59,7 +59,7 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
59
59
let socketAddress = try ! SocketAddress . makeAddressResolvingHost ( " localhost " , port: 0 )
60
60
XCTAssertNoThrow ( try embedded. connect ( to: socketAddress) . wait ( ) )
61
61
62
- let proxyConnectHandler = HTTP1ProxyConnectHandler (
62
+ let proxyConnectHandler = NIOHTTP1ProxyConnectHandler (
63
63
targetHost: " swift.org " ,
64
64
targetPort: 443 ,
65
65
headers: [ " proxy-authorization " : " Basic abc123 " ] ,
@@ -92,7 +92,7 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
92
92
let socketAddress = try ! SocketAddress . makeAddressResolvingHost ( " localhost " , port: 0 )
93
93
XCTAssertNoThrow ( try embedded. connect ( to: socketAddress) . wait ( ) )
94
94
95
- let proxyConnectHandler = HTTP1ProxyConnectHandler (
95
+ let proxyConnectHandler = NIOHTTP1ProxyConnectHandler (
96
96
targetHost: " swift.org " ,
97
97
targetPort: 443 ,
98
98
headers: [ : ] ,
@@ -115,13 +115,13 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
115
115
let responseHead = HTTPResponseHead ( version: . http1_1, status: . internalServerError)
116
116
// answering with 500 should lead to a triggered error in pipeline
117
117
XCTAssertThrowsError ( try embedded. writeInbound ( HTTPClientResponsePart . head ( responseHead) ) ) {
118
- XCTAssertEqual ( $0 as? HTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
118
+ XCTAssertEqual ( $0 as? NIOHTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
119
119
}
120
120
XCTAssertFalse ( embedded. isActive, " Channel should be closed in response to the error " )
121
121
XCTAssertNoThrow ( try embedded. writeInbound ( HTTPClientResponsePart . end ( nil ) ) )
122
122
123
123
XCTAssertThrowsError ( try XCTUnwrap ( proxyConnectHandler. proxyEstablishedFuture) . wait ( ) ) {
124
- XCTAssertEqual ( $0 as? HTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
124
+ XCTAssertEqual ( $0 as? NIOHTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
125
125
}
126
126
}
127
127
@@ -131,7 +131,7 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
131
131
let socketAddress = try ! SocketAddress . makeAddressResolvingHost ( " localhost " , port: 0 )
132
132
XCTAssertNoThrow ( try embedded. connect ( to: socketAddress) . wait ( ) )
133
133
134
- let proxyConnectHandler = HTTP1ProxyConnectHandler (
134
+ let proxyConnectHandler = NIOHTTP1ProxyConnectHandler (
135
135
targetHost: " swift.org " ,
136
136
targetPort: 443 ,
137
137
headers: [ : ] ,
@@ -154,13 +154,13 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
154
154
let responseHead = HTTPResponseHead ( version: . http1_1, status: . proxyAuthenticationRequired)
155
155
// answering with 500 should lead to a triggered error in pipeline
156
156
XCTAssertThrowsError ( try embedded. writeInbound ( HTTPClientResponsePart . head ( responseHead) ) ) {
157
- XCTAssertEqual ( $0 as? HTTP1ProxyConnectHandler . Error , . proxyAuthenticationRequired)
157
+ XCTAssertEqual ( $0 as? NIOHTTP1ProxyConnectHandler . Error , . proxyAuthenticationRequired)
158
158
}
159
159
XCTAssertFalse ( embedded. isActive, " Channel should be closed in response to the error " )
160
160
XCTAssertNoThrow ( try embedded. writeInbound ( HTTPClientResponsePart . end ( nil ) ) )
161
161
162
162
XCTAssertThrowsError ( try XCTUnwrap ( proxyConnectHandler. proxyEstablishedFuture) . wait ( ) ) {
163
- XCTAssertEqual ( $0 as? HTTP1ProxyConnectHandler . Error , . proxyAuthenticationRequired)
163
+ XCTAssertEqual ( $0 as? NIOHTTP1ProxyConnectHandler . Error , . proxyAuthenticationRequired)
164
164
}
165
165
}
166
166
@@ -170,7 +170,7 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
170
170
let socketAddress = try ! SocketAddress . makeAddressResolvingHost ( " localhost " , port: 0 )
171
171
XCTAssertNoThrow ( try embedded. connect ( to: socketAddress) . wait ( ) )
172
172
173
- let proxyConnectHandler = HTTP1ProxyConnectHandler (
173
+ let proxyConnectHandler = NIOHTTP1ProxyConnectHandler (
174
174
targetHost: " swift.org " ,
175
175
targetPort: 443 ,
176
176
headers: [ : ] ,
@@ -193,13 +193,13 @@ class HTTP1ProxyConnectHandlerTests: XCTestCase {
193
193
XCTAssertNoThrow ( try embedded. writeInbound ( HTTPClientResponsePart . head ( responseHead) ) )
194
194
// answering with a body should lead to a triggered error in pipeline
195
195
XCTAssertThrowsError ( try embedded. writeInbound ( HTTPClientResponsePart . body ( ByteBuffer ( bytes: [ 0 , 1 , 2 , 3 ] ) ) ) ) {
196
- XCTAssertEqual ( $0 as? HTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
196
+ XCTAssertEqual ( $0 as? NIOHTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
197
197
}
198
198
XCTAssertEqual ( embedded. isActive, false )
199
199
XCTAssertNoThrow ( try embedded. writeInbound ( HTTPClientResponsePart . end ( nil ) ) )
200
200
201
201
XCTAssertThrowsError ( try XCTUnwrap ( proxyConnectHandler. proxyEstablishedFuture) . wait ( ) ) {
202
- XCTAssertEqual ( $0 as? HTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
202
+ XCTAssertEqual ( $0 as? NIOHTTP1ProxyConnectHandler . Error , . invalidProxyResponse)
203
203
}
204
204
}
205
205
}
0 commit comments