mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2026-01-05 17:13:28 +09:00
#63 made as default behaviour the creation of a scheduler instance
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +1,3 @@
|
||||
server:
|
||||
servlet:
|
||||
context-path: /
|
||||
session.timeout : 28800
|
||||
port: 8080
|
||||
|
||||
quartz:
|
||||
enabled: true
|
||||
|
||||
quartz-manager:
|
||||
jobClassPackages: it.fabioformosa.quartzmanager.jobs
|
||||
security:
|
||||
|
||||
Reference in New Issue
Block a user