use of org.mybatis.spring.SqlSessionTemplate in project pinpoint by naver.
the class SqlSessionTemplateITBase method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
Configuration configuration = mock(Configuration.class);
TransactionFactory transactionFactory = mock(TransactionFactory.class);
DataSource dataSource = mock(DataSource.class);
Environment environment = new Environment("test", transactionFactory, dataSource);
when(configuration.getEnvironment()).thenReturn(environment);
when(this.sqlSessionFactory.getConfiguration()).thenReturn(configuration);
when(this.sqlSessionFactory.openSession(EXECUTOR_TYPE)).thenReturn(this.sqlSessionProxy);
this.sqlSessionTemplate = new SqlSessionTemplate(this.sqlSessionFactory, EXECUTOR_TYPE);
}
Aggregations