testWebSocketClientHandshakeException() — netty Function Reference
Architecture documentation for the testWebSocketClientHandshakeException() function in WebSocketClientHandshakerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 3a3a0ead_85b7_b289_4089_73bf0815d389["testWebSocketClientHandshakeException()"] 2cb6ab9a_d30f_c725_5b7e_5ad8d513e6b9["WebSocketClientHandshakerTest"] 3a3a0ead_85b7_b289_4089_73bf0815d389 -->|defined in| 2cb6ab9a_d30f_c725_5b7e_5ad8d513e6b9 style 3a3a0ead_85b7_b289_4089_73bf0815d389 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerTest.java lines 458–476
@Test
public void testWebSocketClientHandshakeException() {
URI uri = URI.create("ws://localhost:9999/exception");
WebSocketClientHandshaker handshaker = newHandshaker(uri, null, null, false, true);
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.UNAUTHORIZED);
response.headers().set(HttpHeaderNames.WWW_AUTHENTICATE, "realm = access token required");
try {
handshaker.finishHandshake(null, response);
fail("Expected WebSocketClientHandshakeException");
} catch (WebSocketClientHandshakeException exception) {
assertEquals("Invalid handshake response getStatus: 401 Unauthorized", exception.getMessage());
assertEquals(HttpResponseStatus.UNAUTHORIZED, exception.response().status());
assertTrue(exception.response().headers().contains(HttpHeaderNames.WWW_AUTHENTICATE,
"realm = access token required", false));
} finally {
response.release();
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does testWebSocketClientHandshakeException() do?
testWebSocketClientHandshakeException() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerTest.java.
Where is testWebSocketClientHandshakeException() defined?
testWebSocketClientHandshakeException() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerTest.java at line 458.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free