public static DropwizardResourceConfig forTesting(@Nullable MetricRegistry metricRegistry) {
        final DropwizardResourceConfig config = new DropwizardResourceConfig(metricRegistry);
        // See org.glassfish.jersey.test.TestProperties#CONTAINER_PORT
        config.property("jersey.config.test.container.port", "0");
        return config;
    }
public static DropwizardResourceConfig forTesting ( @ Nullable MetricRegistry metricRegistry ) { final DropwizardResourceConfig config = new DropwizardResourceConfig ( metricRegistry ) ; config . property ( "jersey.config.test.container.port" , "0" ) ; return config ; }
Build a {@link DropwizardResourceConfig} which makes Jersey Test run on a random port,
also see {@code org.glassfish.jersey.test.TestProperties#CONTAINER_PORT}.