Search in sources :

Example 1 with WebBrowserSimulator

use of org.webpieces.webserver.test.WebBrowserSimulator in project webpieces by deanhiller.

the class TestLesson7AdvancedCookiesCrud method setUp.

@Before
public void setUp() throws InterruptedException, ClassNotFoundException, ExecutionException, TimeoutException {
    log.info("Setting up test");
    Asserts.assertWasCompiledWithParamNames("test");
    // clear in-memory database
    jdbc.dropAllTablesFromDatabase();
    SimpleMeterRegistry metrics = new SimpleMeterRegistry();
    // you may want to create this server ONCE in a static method BUT if you do, also remember to clear out all your
    // mocks after every test AND you can no longer run single threaded(tradeoffs, tradeoffs)
    // This is however pretty fast to do in many systems...
    Server webserver = new Server(getOverrides(metrics), null, new ServerConfig(JavaCache.getCacheLocation()), args);
    webserver.start();
    HttpSocket https11Socket = connectHttps(null, webserver.getUnderlyingHttpChannel().getLocalAddress());
    webBrowser = new WebBrowserSimulator(https11Socket);
}
Also used : ServerConfig(org.webpieces.webserver.api.ServerConfig) HttpSocket(org.webpieces.httpclient11.api.HttpSocket) WebBrowserSimulator(org.webpieces.webserver.test.WebBrowserSimulator) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) Before(org.junit.Before)

Aggregations

SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)1 Before (org.junit.Before)1 HttpSocket (org.webpieces.httpclient11.api.HttpSocket)1 ServerConfig (org.webpieces.webserver.api.ServerConfig)1 WebBrowserSimulator (org.webpieces.webserver.test.WebBrowserSimulator)1