@Override
    public void configure() throws Exception {
        server.addEventListener(mbeans());
        server.addConnector(plainConnector());

        ContextHandlerCollection handlers = new ContextHandlerCollection();
        deploymentManager.setContexts(handlers);

        webAppContext = createWebAppContext();

        JettyCustomErrorPageHandler errorHandler = new JettyCustomErrorPageHandler();
        webAppContext.setErrorHandler(errorHandler);
        webAppContext.insertHandler(gzipHandler());
        server.addBean(errorHandler);
        server.addBean(deploymentManager);

        HandlerCollection serverLevelHandlers = new HandlerCollection();
        serverLevelHandlers.setHandlers(new Handler[]{handlers});
        server.setHandler(serverLevelHandlers);

        performCustomConfiguration();
        server.setStopAtShutdown(true);
    }
@Test
    public void shouldSetStopAtShutdown() throws Exception {
        jettyServer.configure();
        verify(server).setStopAtShutdown(true);
    }