Search in sources :

Example 6 with AdditionalBeanBuildItem

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

the class JobRunrExtensionProcessorTest method producesJobRunrProducerUsesJSONBIfCapabilityPresent.

@Test
void producesJobRunrProducerUsesJSONBIfCapabilityPresent() {
    Mockito.reset(capabilities);
    lenient().when(capabilities.isPresent(Capability.JSONB)).thenReturn(true);
    final AdditionalBeanBuildItem additionalBeanBuildItem = jobRunrExtensionProcessor.produce(capabilities);
    assertThat(additionalBeanBuildItem.getBeanClasses()).contains(JobRunrProducer.JobRunrJsonBJsonMapperProducer.class.getName());
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) Test(org.junit.jupiter.api.Test)

Example 7 with AdditionalBeanBuildItem

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

the class JobRunrExtensionProcessorTest method producesJobRunrProducerUsesMongoDBStorageProviderIfMongoDBClientCapabilityIsPresent.

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

Example 8 with AdditionalBeanBuildItem

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

the class JobRunrExtensionProcessorTest method addMetricsDoesAddStorageProviderMetricsIfEnabledAndMicroMeterSupport.

@Test
void addMetricsDoesAddStorageProviderMetricsIfEnabledAndMicroMeterSupport() {
    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()).doesNotContain(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 9 with AdditionalBeanBuildItem

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

the class JobRunrExtensionProcessorTest method producesJobRunrProducerUsesSqlStorageProviderIfAgroalCapabilityIsPresent.

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

Example 10 with AdditionalBeanBuildItem

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

the class JobRunrExtensionProcessorTest method producesJobRunrProducerUsesJacksonIfCapabilityPresent.

@Test
void producesJobRunrProducerUsesJacksonIfCapabilityPresent() {
    Mockito.reset(capabilities);
    lenient().when(capabilities.isPresent(Capability.JACKSON)).thenReturn(true);
    final AdditionalBeanBuildItem additionalBeanBuildItem = jobRunrExtensionProcessor.produce(capabilities);
    assertThat(additionalBeanBuildItem.getBeanClasses()).contains(JobRunrProducer.JobRunrJacksonJsonMapperProducer.class.getName());
}
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