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);
}
Aggregations