diff --git a/pom.xml b/pom.xml index fce309081f..e6f827a2b6 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 1.8 - 9.3.6.v20151106 + 9.3.13.v20161014 UTF-8 1.6.4 1.10.19 diff --git a/src/test/java/spark/embeddedserver/jetty/websocket/WebSocketServletContextHandlerFactoryTest.java b/src/test/java/spark/embeddedserver/jetty/websocket/WebSocketServletContextHandlerFactoryTest.java index 1aa7e85080..123d26b243 100644 --- a/src/test/java/spark/embeddedserver/jetty/websocket/WebSocketServletContextHandlerFactoryTest.java +++ b/src/test/java/spark/embeddedserver/jetty/websocket/WebSocketServletContextHandlerFactoryTest.java @@ -1,10 +1,10 @@ package spark.embeddedserver.jetty.websocket; +import org.eclipse.jetty.http.pathmap.MappedResource; +import org.eclipse.jetty.http.pathmap.PathSpec; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.websocket.server.WebSocketServerFactory; import org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter; -import org.eclipse.jetty.websocket.server.pathmap.PathMappings; -import org.eclipse.jetty.websocket.server.pathmap.PathSpec; import org.eclipse.jetty.websocket.servlet.WebSocketCreator; import org.junit.Test; import org.junit.runner.RunWith; @@ -47,12 +47,12 @@ public void testCreate_whenNoIdleTimeoutIsPresent() throws Exception { assertNotNull("Should return a WebSocketUpgradeFilter because we configured it to have one", webSocketUpgradeFilter); - PathMappings.MappedResource mappedResource = webSocketUpgradeFilter.getMappings().getMatch("/websocket"); + MappedResource mappedResource = webSocketUpgradeFilter.getMappings().getMatch("/websocket"); WebSocketCreatorFactory.SparkWebSocketCreator sc = (WebSocketCreatorFactory.SparkWebSocketCreator) mappedResource.getResource(); PathSpec pathSpec = (PathSpec) mappedResource.getPathSpec(); - assertEquals("Should return the WebSocket path specified when contexst handler was created", - webSocketPath, pathSpec.getPathSpec()); + assertTrue("Should return the WebSocket path specified when contexst handler was created", + pathSpec.matches(webSocketPath)); assertTrue("Should return true because handler should be an instance of the one we passed when it was created", sc.getHandler() instanceof WebSocketTestHandler); @@ -79,12 +79,12 @@ public void testCreate_whenTimeoutIsPresent() throws Exception { assertEquals("Timeout value should be the same as the timeout specified when context handler was created", timeout.longValue(), webSocketServerFactory.getPolicy().getIdleTimeout()); - PathMappings.MappedResource mappedResource = webSocketUpgradeFilter.getMappings().getMatch("/websocket"); + MappedResource mappedResource = webSocketUpgradeFilter.getMappings().getMatch("/websocket"); WebSocketCreatorFactory.SparkWebSocketCreator sc = (WebSocketCreatorFactory.SparkWebSocketCreator) mappedResource.getResource(); PathSpec pathSpec = (PathSpec) mappedResource.getPathSpec(); - assertEquals("Should return the WebSocket path specified when context handler was created", - webSocketPath, pathSpec.getPathSpec()); + assertTrue("Should return the WebSocket path specified when context handler was created", + pathSpec.matches(webSocketPath)); assertTrue("Should return true because handler should be an instance of the one we passed when it was created", sc.getHandler() instanceof WebSocketTestHandler);