use of io.quarkus.runtime.ShutdownEvent in project jobrunr by jobrunr.
the class JobRunrStarterTest method jobRunrStarterStopsStorageProvider.
@Test
void jobRunrStarterStopsStorageProvider() {
jobRunrStarter.shutdown(new ShutdownEvent());
verify(storageProvider).close();
}
use of io.quarkus.runtime.ShutdownEvent in project jobrunr by jobrunr.
the class JobRunrStarterTest method jobRunrStarterStopsBackgroundJobServerIfConfigured.
@Test
void jobRunrStarterStopsBackgroundJobServerIfConfigured() {
backgroundJobServerConfiguration.enabled = true;
jobRunrStarter.shutdown(new ShutdownEvent());
verify(backgroundJobServer).stop();
}
use of io.quarkus.runtime.ShutdownEvent in project quarkus by quarkusio.
the class ArcRecorder method handleLifecycleEvents.
public void handleLifecycleEvents(ShutdownContext context, LaunchMode launchMode, boolean disableApplicationLifecycleObservers) {
ArcContainerImpl container = ArcContainerImpl.instance();
List<Class<?>> mockBeanClasses;
// If needed then mock all app observers in the test mode
if (launchMode == LaunchMode.TEST && disableApplicationLifecycleObservers) {
Predicate<String> predicate = container.select(TestApplicationClassPredicate.class).get();
mockBeanClasses = new ArrayList<>();
for (InjectableBean<?> bean : container.getBeans()) {
// Mock observers for all application class beans
if (bean.getKind() == Kind.CLASS && predicate.test(bean.getBeanClass().getName())) {
mockBeanClasses.add(bean.getBeanClass());
}
}
} else {
mockBeanClasses = Collections.emptyList();
}
fireLifecycleEvent(container, new StartupEvent(), mockBeanClasses);
context.addShutdownTask(new Runnable() {
@Override
public void run() {
fireLifecycleEvent(container, new ShutdownEvent(), mockBeanClasses);
}
});
}
use of io.quarkus.runtime.ShutdownEvent in project kogito-apps by kiegroup.
the class TaskAssigningServiceTest method onShutDownEvent.
@Test
void onShutDownEvent() throws Exception {
prepareStart();
taskAssigningService.onShutDownEvent(new ShutdownEvent());
verifyDestroy();
}
Aggregations