Skip to content

Commit

Permalink
#258 Lazy init for SqlStatementsSource
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed May 31, 2020
1 parent d80647c commit 27ac1b2
Showing 1 changed file with 27 additions and 0 deletions.
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);
}

}

0 comments on commit 27ac1b2

Please sign in to comment.