#63 made as default behaviour the creation of a scheduler instance

This commit is contained in:
Fabio Formosa
2022-10-01 16:12:26 +02:00
parent 44d6854bc5
commit 1571ab6d12
3 changed files with 22 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ import java.util.Properties;
@ComponentScan(basePackages = {"it.fabioformosa.quartzmanager.controllers"})
@Configuration
@ConditionalOnProperty(name = "quartz.enabled")
@ConditionalOnProperty(name = "quartz.enabled", matchIfMissing = true)
public class SchedulerConfig {
@Autowired(required = false)

View File

@@ -0,0 +1,21 @@
package it.fabioformosa.quartzmanager.configuration;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SchedulerConfigDefaultAppPropertiesTest {
@Autowired
private Scheduler scheduler;
@Test
void givenTheQuartzPropMissing_whenTheBootstrapOccurs_thenAQuartzInstanceShouldBeInstanciated(){
Assertions.assertThat(scheduler).isNotNull();
}
}

View File

@@ -1,12 +1,3 @@
server:
servlet:
context-path: /
session.timeout : 28800
port: 8080
quartz:
enabled: true
quartz-manager:
jobClassPackages: it.fabioformosa.quartzmanager.jobs
security: