@Test
public void testCreateJvmMetricEnable()
        throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {

    setProperty(PrometheusMetricFactory.JVM_ENABLE_PROP, "true");
    setProperty(PrometheusMetricFactory.HTTP_SERVER_ENABLE_PROP, "false");
    PrometheusMetric metric = (PrometheusMetric) new PrometheusMetricFactory().create();
    clearProperty(PrometheusMetricFactory.JVM_ENABLE_PROP);
    clearProperty(PrometheusMetricFactory.HTTP_SERVER_ENABLE_PROP);
    Field registryField = metric.getClass().getDeclaredField("registry");
    registryField.setAccessible(true);
    CollectorRegistry registry = (CollectorRegistry) registryField.get(metric);
    // assertions
    Assert.assertNotNull(registry.getSampleValue("process_cpu_seconds_total"));
}