-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#258 Lazy init for SqlStatementsSource
- Loading branch information
1 parent
d80647c
commit 27ac1b2
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...t/java/net/javacrumbs/shedlock/provider/jdbctemplate/JdbcTemplateStorageAccessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.javacrumbs.shedlock.provider.jdbctemplate; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.verifyZeroInteractions; | ||
|
||
class JdbcTemplateStorageAccessorTest { | ||
|
||
@Test | ||
void shouldDoLazyInit() { | ||
DataSource dataSource = mock(DataSource.class); | ||
new JdbcTemplateStorageAccessor( | ||
JdbcTemplateLockProvider.Configuration | ||
.builder() | ||
.withJdbcTemplate(new JdbcTemplate(dataSource)) | ||
.build() | ||
); | ||
|
||
verifyZeroInteractions(dataSource); | ||
} | ||
|
||
} |