DevModeHandler implements RequestHandler { public static DevModeHandler start(DeploymentConfiguration configuration, File npmFolder, CompletableFuture<Void> waitFor) { return start(0, configuration, npmFolder, waitFor); } private  DevModeHandler(DeploymentConfiguration config, int runningPort,
            File npmFolder, CompletableFuture<Void> waitFor); static DevModeHandler start(DeploymentConfiguration configuration,
            File npmFolder, CompletableFuture<Void> waitFor); static DevModeHandler start(int runningPort,
            DeploymentConfiguration configuration, File npmFolder,
            CompletableFuture<Void> waitFor); static DevModeHandler getDevModeHandler(); void setLiveReload(BrowserLiveReload liveReload); BrowserLiveReload getLiveReload(); @Override boolean handleRequest(VaadinSession session, VaadinRequest request,
            VaadinResponse response); boolean isDevModeRequest(HttpServletRequest request); boolean serveDevModeRequest(HttpServletRequest request,
            HttpServletResponse response); HttpURLConnection prepareConnection(String path, String method); String getFailedOutput(); void removeRunningDevServerPort(); int getPort(); boolean reuseDevServer(); void stop(); static final String WEBPACK_SERVER; }
@Test @Ignore("Ignored due to failing rate on CI") public void should_Fail_When_WebpackPrematurelyExit() throws Exception { exception.expect(IllegalStateException.class); exception.expectMessage("Webpack exited prematurely"); createStubWebpackServer("Foo", 0, baseDir); DevModeHandler.start(configuration, npmFolder, CompletableFuture.completedFuture(null)); }
@Test public void shouldNot_CreateInstance_When_ProductionMode() throws Exception { configuration.setProductionMode(true); DevModeHandler handler = DevModeHandler.start(configuration, npmFolder, CompletableFuture.completedFuture(null)); assertNull(handler); }
@Test public void enableDevServerFalse_shouldNotCreateInstance() throws Exception { configuration.setEnableDevServer(false); DevModeHandler handler = DevModeHandler.start(configuration, npmFolder, CompletableFuture.completedFuture(null)); assertNull(handler); }