@EventListener
    void shutdown(ShutdownEvent event) {
        if (configuration.getBackgroundJobServer().isEnabled()) {
            backgroundJobServer.get().stop();
        }
        if (configuration.getDashboard().isEnabled()) {
            dashboardWebServer.get().stop();
        }
        storageProvider.close();
    }
@Test
    void onStopOptionalsAreNotToBootstrapIfConfigured() {
        when(backgroundJobServerConfiguration.isEnabled()).thenReturn(true);
        when(dashboardConfiguration.isEnabled()).thenReturn(true);

        jobRunrStarter.shutdown(null);

        verify(backgroundJobServer).stop();
        verify(dashboardWebServer).stop();
        verify(storageProvider).close();
    }