Skip to content

Commit

Permalink
Extract ShedlockConfig in test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Nov 25, 2024
1 parent d6e0903 commit 8be6ffd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@
*/
package net.javacrumbs.shedlock.test.boot;

import javax.sql.DataSource;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
Expand All @@ -31,8 +27,4 @@ public static void main(String[] args) {
SpringApplication.run(Application.class);
}

@Bean
public LockProvider lockProvider(DataSource dataSource) {
return new JdbcTemplateLockProvider(dataSource, "shedlock");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.javacrumbs.shedlock.test.boot;

import javax.sql.DataSource;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ShedlockConfig {
@Bean
public LockProvider lockProvider(DataSource dataSource) {
return new JdbcTemplateLockProvider(dataSource, "shedlock");
}
}

0 comments on commit 8be6ffd

Please sign in to comment.