@BuildStep
    AdditionalBeanBuildItem addMetrics(Optional<MetricsCapabilityBuildItem> metricsCapability, JobRunrBuildTimeConfiguration jobRunrBuildTimeConfiguration) {
        if (metricsCapability.isPresent() && metricsCapability.get().metricsSupported(MetricsFactory.MICROMETER)) {
            final AdditionalBeanBuildItem.Builder additionalBeanBuildItemBuilder = AdditionalBeanBuildItem.builder()
                    .setUnremovable()
                    .addBeanClasses(JobRunrMetricsStarter.class)
                    .addBeanClasses(JobRunrMetricsProducer.StorageProviderMetricsProducer.class);

            if (jobRunrBuildTimeConfiguration.backgroundJobServer().enabled()) {
                additionalBeanBuildItemBuilder.addBeanClasses(JobRunrMetricsProducer.BackgroundJobServerMetricsProducer.class);
            }
            return additionalBeanBuildItemBuilder
                    .build();
        }
        return null;
    }
@Test
    void addMetricsDoesAddStorageProviderMetricsIfEnabledAndMicroMeterSupport() {
        final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.of(new MetricsCapabilityBuildItem(toSupport -> toSupport.equals(MetricsFactory.MICROMETER))), jobRunrBuildTimeConfiguration);

        assertThat(metricsBeanBuildItem.getBeanClasses())
                .contains(JobRunrMetricsStarter.class.getName())
                .contains(JobRunrMetricsProducer.StorageProviderMetricsProducer.class.getName())
                .doesNotContain(JobRunrMetricsProducer.BackgroundJobServerMetricsProducer.class.getName());
    }