Search in sources :

Example 1 with ShutdownEvent

use of io.quarkus.runtime.ShutdownEvent in project jobrunr by jobrunr.

the class JobRunrStarterTest method jobRunrStarterDoesNotStopsDashboardIfNotConfigured.

@Test
void jobRunrStarterDoesNotStopsDashboardIfNotConfigured() {
    dashboardConfiguration.enabled = false;
    jobRunrStarter.shutdown(new ShutdownEvent());
    verify(dashboardWebServerInstance, never()).get();
}
Also used : ShutdownEvent(io.quarkus.runtime.ShutdownEvent) Test(org.junit.jupiter.api.Test)

Example 2 with ShutdownEvent

use of io.quarkus.runtime.ShutdownEvent in project jobrunr by jobrunr.

the class JobRunrStarterTest method jobRunrStarterStopsDashboardIfConfigured.

@Test
void jobRunrStarterStopsDashboardIfConfigured() {
    dashboardConfiguration.enabled = true;
    jobRunrStarter.shutdown(new ShutdownEvent());
    verify(dashboardWebServer).stop();
}
Also used : ShutdownEvent(io.quarkus.runtime.ShutdownEvent) Test(org.junit.jupiter.api.Test)

Example 3 with ShutdownEvent

use of io.quarkus.runtime.ShutdownEvent in project quarkus by quarkusio.

the class KafkaEventObserverTest method testAllKafkaClientMetricsClosed.

@Test
void testAllKafkaClientMetricsClosed() {
    KafkaEventObserver sut = new KafkaEventObserver();
    KafkaClientMetrics firstClientMetrics = Mockito.mock(KafkaClientMetrics.class);
    KafkaClientMetrics secondClientMetrics = Mockito.mock(KafkaClientMetrics.class);
    sut.clientMetrics.put(firstClientMetrics, firstClientMetrics);
    sut.clientMetrics.put(secondClientMetrics, secondClientMetrics);
    sut.onStop(new ShutdownEvent());
    Mockito.verify(firstClientMetrics).close();
    Mockito.verify(secondClientMetrics).close();
}
Also used : ShutdownEvent(io.quarkus.runtime.ShutdownEvent) KafkaClientMetrics(io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics) Test(org.junit.jupiter.api.Test)

Example 4 with ShutdownEvent

use of io.quarkus.runtime.ShutdownEvent in project quarkus by quarkusio.

the class KafkaStreamsEventObserverTest method testKafkaStreamsMetricsClosedAfterShutdownEvent.

@Test
void testKafkaStreamsMetricsClosedAfterShutdownEvent() {
    KafkaStreamsEventObserver sut = new KafkaStreamsEventObserver();
    sut.kafkaStreamsMetrics = Mockito.mock(KafkaStreamsMetrics.class);
    sut.onStop(new ShutdownEvent());
    Mockito.verify(sut.kafkaStreamsMetrics).close();
}
Also used : KafkaStreamsMetrics(io.micrometer.core.instrument.binder.kafka.KafkaStreamsMetrics) ShutdownEvent(io.quarkus.runtime.ShutdownEvent) Test(org.junit.jupiter.api.Test)

Example 5 with ShutdownEvent

use of io.quarkus.runtime.ShutdownEvent in project jobrunr by jobrunr.

the class JobRunrStarterTest method jobRunrStarterDoesNotStopBackgroundJobServerIfNotConfigured.

@Test
void jobRunrStarterDoesNotStopBackgroundJobServerIfNotConfigured() {
    backgroundJobServerConfiguration.enabled = false;
    jobRunrStarter.shutdown(new ShutdownEvent());
    verify(backgroundJobServerInstance, never()).get();
}
Also used : ShutdownEvent(io.quarkus.runtime.ShutdownEvent) Test(org.junit.jupiter.api.Test)

Aggregations

ShutdownEvent (io.quarkus.runtime.ShutdownEvent)9 Test (org.junit.jupiter.api.Test)8 KafkaClientMetrics (io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics)1 KafkaStreamsMetrics (io.micrometer.core.instrument.binder.kafka.KafkaStreamsMetrics)1 ArcContainerImpl (io.quarkus.arc.impl.ArcContainerImpl)1 PreloadedTestApplicationClassPredicate (io.quarkus.arc.runtime.test.PreloadedTestApplicationClassPredicate)1 StartupEvent (io.quarkus.runtime.StartupEvent)1 TestApplicationClassPredicate (io.quarkus.runtime.test.TestApplicationClassPredicate)1