private static SockJsServiceFactory factoryFor(final SockJsService service, final SockJsConfig config) {
final SockJsServiceFactory factory = mock(SockJsServiceFactory.class);
when(service.config()).thenReturn(config);
when(factory.config()).thenReturn(config);
when(factory.create()).thenReturn(service);
return factory;
}
private static EmbeddedChannel channelForService(final SockJsServiceFactory service) {
return new TestEmbeddedChannel(