templates.repository.sp.SqlQueryTest.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoplsp Show documentation
Show all versions of autoplsp Show documentation
Maven plugin to generate Java classes from StoredProcedure and Functions in Database
package ${javaPackage}.repository.sp;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
@SuppressWarnings({"rawtypes", "unchecked"})
public class ${proc.className}SqlQueryTest {
@Mock
private javax.sql.DataSource dataSource;
@Mock
private org.springframework.jdbc.core.JdbcTemplate jdbcTemplate;
@Test
public void test${proc.className}SqlQueryDataSource() throws java.sql.SQLException {
Mockito.when(jdbcTemplate.getDataSource()).thenReturn(dataSource);
${proc.className}SqlQueryImpl sp = new ${proc.className}SqlQueryImpl(jdbcTemplate);
Assert.assertSame(dataSource, sp.getJdbcTemplate().getDataSource());
}
}