use of spark.embeddedserver.jetty.websocket.WebSocketCreatorFactory.SparkWebSocketCreator in project spark by perwendel.
the class WebSocketCreatorFactoryTest method testCreateWebSocketHandler.
@Test
public void testCreateWebSocketHandler() {
WebSocketCreator annotated = WebSocketCreatorFactory.create(new WebSocketHandlerClassWrapper(AnnotatedHandler.class));
assertTrue(annotated instanceof SparkWebSocketCreator);
assertTrue(SparkWebSocketCreator.class.cast(annotated).getHandler() instanceof AnnotatedHandler);
WebSocketCreator listener = WebSocketCreatorFactory.create(new WebSocketHandlerClassWrapper(ListenerHandler.class));
assertTrue(listener instanceof SparkWebSocketCreator);
assertTrue(SparkWebSocketCreator.class.cast(listener).getHandler() instanceof ListenerHandler);
}
Aggregations