@Before
public void setUp() throws Exception {
objectUnderTest = new HttpServerBuilder();
webSocketMessageConsumer = webSocketMessage -> {
};
httpRequestConsumer = request -> {
};
FactorySPI.setFactory(new Factory() {
public HttpServer createHttpServer(HttpServerOptions options,
String endpointName,
QBitSystemManager systemManager,
ServiceDiscovery serviceDiscovery,
HealthServiceAsync healthServiceAsync,
final int serviceDiscoveryTtl,
final TimeUnit serviceDiscoveryTtlTimeUnit,
final CopyOnWriteArrayList<HttpResponseDecorator> decorators,
final HttpResponseCreator httpResponseCreator, RequestContinuePredicate requestBodyContinuePredicate) {
return FactorySPI.getHttpServerFactory().create(options, endpointName, systemManager, serviceDiscovery,
healthServiceAsync, serviceDiscoveryTtl, serviceDiscoveryTtlTimeUnit, decorators, httpResponseCreator, requestBodyContinuePredicate);
}
});
FactorySPI.setHttpServerFactory((options, name, systemManager, serviceDiscovery, healthServiceAsync, a, b, c, d, z)
-> new SimpleHttpServer());
Sys.sleep(100);
}