use of com.tvd12.ezyfoxserver.nio.EzyWebSocketServerBootstrap in project ezyfox-server by youngmonkeys.
the class EzyWebSocketServerBootstrapTest method newSocketServerCreatorWithSSL.
@Test
public void newSocketServerCreatorWithSSL() {
// given
SSLContext sslContext = mock(SSLContext.class);
EzyServerContext serverContext = mock(EzyServerContext.class);
EzySimpleServer server = new EzySimpleServer();
when(serverContext.getServer()).thenReturn(server);
EzySimpleSettings settings = new EzySimpleSettings();
settings.getWebsocket().setSslActive(true);
server.setSettings(settings);
EzyWebSocketServerBootstrap sut = EzyWebSocketServerBootstrap.builder().sslContext(sslContext).serverContext(serverContext).build();
// when
EzyWebSocketServerCreator creator = MethodUtil.invokeMethod("newSocketServerCreator", sut);
// then
Asserts.assertNotNull(creator);
}
Aggregations