Skip to content

Commit 29e3acc

Browse files
committed
Re-enable Jetty in spring-websocket tests
1 parent 5d45439 commit 29e3acc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/adapter/jetty/JettyWebSocketSession.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,13 @@ public void initializeNativeSession(Session session) {
191191
this.extensions = getExtensions(session);
192192

193193
if (this.user == null) {
194-
this.user = session.getUpgradeRequest().getUserPrincipal();
194+
try {
195+
this.user = session.getUpgradeRequest().getUserPrincipal();
196+
}
197+
catch (NullPointerException ex) {
198+
// Necessary until https://github.com/eclipse/jetty.project/issues/10498 is resolved
199+
logger.error("Failure from UpgradeRequest while getting Principal", ex);
200+
}
195201
}
196202
}
197203

spring-websocket/src/test/java/org/springframework/web/socket/AbstractWebSocketIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public abstract class AbstractWebSocketIntegrationTests {
6262

6363
static Stream<Arguments> argumentsFactory() {
6464
return Stream.of(
65+
arguments(named("Jetty", new JettyWebSocketTestServer()), named("Standard", new StandardWebSocketClient())),
6566
arguments(named("Tomcat", new TomcatWebSocketTestServer()), named("Standard", new StandardWebSocketClient())),
6667
arguments(named("Undertow", new UndertowTestServer()), named("Standard", new StandardWebSocketClient())));
6768
}

0 commit comments

Comments
 (0)