public static Application fromServicesXml(String xml, Networking networking) {
        Path applicationDir = StandaloneContainerRunner.createApplicationPackage(xml);
        return new Application(applicationDir, networking, true);
    }
@Test
    void http_interface_is_off_when_networking_is_disabled() throws Exception {
        assertThrows(ConnectException.class, () -> {
            int httpPort = getFreePort();
            try (Application application = Application.fromServicesXml(servicesXmlWithServer(httpPort), Networking.disable)) {
                HttpClient client = new org.apache.http.impl.client.DefaultHttpClient();
                int statusCode = client.execute(new HttpGet("http://localhost:" + httpPort)).getStatusLine().getStatusCode();
                fail("Networking.disable is specified, but the network interface is enabled! Got status code: " + statusCode);
                Application unused = application;
            }
        });
    }