Search in sources :

Example 1 with RESTClientCreator

use of org.webpieces.microsvc.client.api.RESTClientCreator in project webpieces by deanhiller.

the class CompanyTest method initialize.

public void initialize() {
    log.info("Setting up test");
    // Necessary to avoid errors that could be confusing to developers...(fail early instead with what is wrong)
    Asserts.assertWasCompiledWithParamNames("test");
    try {
        startServer();
    } catch (IOException ex) {
        throw SneakyThrow.sneak(ex);
    }
    if (serverHttpAddr == null || serverHttpsAddr == null)
        throw new IllegalStateException("startServer method forgot to set the serverHttpAddr and serverHttpsAddr");
    simulateContext();
    Http2Client http2Client = getClient();
    Injector injector = Guice.createInjector(new ClientTestModule(http2Client));
    restClientCreator = injector.getInstance(RESTClientCreator.class);
    initialized = true;
}
Also used : RESTClientCreator(org.webpieces.microsvc.client.api.RESTClientCreator) Injector(com.google.inject.Injector) IOException(java.io.IOException) Http2Client(org.webpieces.http2client.api.Http2Client)

Aggregations

Injector (com.google.inject.Injector)1 IOException (java.io.IOException)1 Http2Client (org.webpieces.http2client.api.Http2Client)1 RESTClientCreator (org.webpieces.microsvc.client.api.RESTClientCreator)1