Search in sources :

Example 11 with AdditionalBeanBuildItem

use of io.quarkus.arc.deployment.AdditionalBeanBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method producesJobRunrProducerUsesElasticSearchStorageProviderIfElasticSearchRestHighLevelClientCapabilityIsPresent.

@Test
void producesJobRunrProducerUsesElasticSearchStorageProviderIfElasticSearchRestHighLevelClientCapabilityIsPresent() {
    lenient().when(capabilities.isPresent(Capability.ELASTICSEARCH_REST_HIGH_LEVEL_CLIENT)).thenReturn(true);
    final AdditionalBeanBuildItem additionalBeanBuildItem = jobRunrExtensionProcessor.produce(capabilities);
    assertThat(additionalBeanBuildItem.getBeanClasses()).contains(JobRunrElasticSearchStorageProviderProducer.class.getName());
}
Also used : JobRunrElasticSearchStorageProviderProducer(org.jobrunr.quarkus.autoconfigure.storage.JobRunrElasticSearchStorageProviderProducer) AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) Test(org.junit.jupiter.api.Test)

Example 12 with AdditionalBeanBuildItem

use of io.quarkus.arc.deployment.AdditionalBeanBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method addMetricsDoesNotAddMetricsIfEnabledButNoMicroMeterSupport.

@Test
void addMetricsDoesNotAddMetricsIfEnabledButNoMicroMeterSupport() {
    final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.of(new MetricsCapabilityBuildItem(toSupport -> false)), jobRunrConfiguration);
    assertThat(metricsBeanBuildItem).isNull();
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) MetricsCapabilityBuildItem(io.quarkus.deployment.metrics.MetricsCapabilityBuildItem) Test(org.junit.jupiter.api.Test)

Example 13 with AdditionalBeanBuildItem

use of io.quarkus.arc.deployment.AdditionalBeanBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method producesJobRunrProducer.

@Test
void producesJobRunrProducer() {
    final AdditionalBeanBuildItem additionalBeanBuildItem = jobRunrExtensionProcessor.produce(capabilities);
    assertThat(additionalBeanBuildItem.getBeanClasses()).contains(JobRunrProducer.class.getName()).contains(JobRunrStarter.class.getName()).contains(JobRunrInMemoryStorageProviderProducer.class.getName()).contains(JobRunrProducer.JobRunrJsonBJsonMapperProducer.class.getName());
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) JobRunrStarter(org.jobrunr.quarkus.autoconfigure.JobRunrStarter) Test(org.junit.jupiter.api.Test)

Example 14 with AdditionalBeanBuildItem

use of io.quarkus.arc.deployment.AdditionalBeanBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method addMetricsDoesAddStorageProviderAndBackgroundJobServerMetricsIfEnabledAndMicroMeterSupport.

@Test
void addMetricsDoesAddStorageProviderAndBackgroundJobServerMetricsIfEnabledAndMicroMeterSupport() {
    backgroundJobServerConfiguration.enabled = true;
    final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.of(new MetricsCapabilityBuildItem(toSupport -> toSupport.equals(MetricsFactory.MICROMETER))), jobRunrConfiguration);
    assertThat(metricsBeanBuildItem.getBeanClasses()).contains(JobRunrMetricsStarter.class.getName()).contains(JobRunrMetricsProducer.StorageProviderMetricsProducer.class.getName()).contains(JobRunrMetricsProducer.BackgroundJobServerMetricsProducer.class.getName());
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) JobRunrMetricsProducer(org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsProducer) MetricsCapabilityBuildItem(io.quarkus.deployment.metrics.MetricsCapabilityBuildItem) JobRunrMetricsStarter(org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsStarter) Test(org.junit.jupiter.api.Test)

Example 15 with AdditionalBeanBuildItem

use of io.quarkus.arc.deployment.AdditionalBeanBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method addMetricsDoesNotAddMetricsIfNotEnabled.

@Test
void addMetricsDoesNotAddMetricsIfNotEnabled() {
    final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.empty(), jobRunrConfiguration);
    assertThat(metricsBeanBuildItem).isNull();
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) Test(org.junit.jupiter.api.Test)

Aggregations

AdditionalBeanBuildItem (io.quarkus.arc.deployment.AdditionalBeanBuildItem)16 Test (org.junit.jupiter.api.Test)10 BuildStep (io.quarkus.deployment.annotations.BuildStep)5 ReflectiveClassBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem)4 MetricsCapabilityBuildItem (io.quarkus.deployment.metrics.MetricsCapabilityBuildItem)4 BuildProducer (io.quarkus.deployment.annotations.BuildProducer)3 CombinedIndexBuildItem (io.quarkus.deployment.builditem.CombinedIndexBuildItem)3 FeatureBuildItem (io.quarkus.deployment.builditem.FeatureBuildItem)3 List (java.util.List)3 ClassInfo (org.jboss.jandex.ClassInfo)3 GitHubApiClassWithBridgeMethodsBuildItem (io.quarkiverse.githubapi.deployment.GitHubApiClassWithBridgeMethodsBuildItem)2 ExecutionTime (io.quarkus.deployment.annotations.ExecutionTime)2 Record (io.quarkus.deployment.annotations.Record)2 MethodCreator (io.quarkus.gizmo.MethodCreator)2 MethodDescriptor (io.quarkus.gizmo.MethodDescriptor)2 ResultHandle (io.quarkus.gizmo.ResultHandle)2 Annotation (java.lang.annotation.Annotation)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 Optional (java.util.Optional)2