package com.goree.api.config;

import javax.sql.DataSource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.goree.api.Application;
import com.goree.api.sample.FooService;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes={Application.class})
public class MyBatisConfigTest {
    @Autowired
    private DataSource dataSource;
    @Autowired
    private FooService service;
    @Autowired
    private SqlSessionFactoryBean sqlSessionFactoryBean;
    @Autowired
    private SqlSessionFactory sqlSessionFactory;
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
    @Autowired
    private SqlSession sqlSession;
    @Autowired
    private DataSourceTransactionManager transactionManager;
    
    @Test
    public void autowiredDatasource() {
        Assert.assertNotNull(dataSource);
    }
    
    @Test
    public void autowiredService() {
        Assert.assertNotNull(service);
    }
    
    @Test
    public void sqlSessionFactoryBeanRegistered() {
        Assert.assertNotNull(sqlSessionFactoryBean);
    }
    
    @Test
    public void sqlSessionFactoryRegistered() {
        Assert.assertNotNull(sqlSessionFactory);
    }
    
    @Test
    public void sqlSessionTemplateRegistered() {
        Assert.assertNotNull(sqlSessionTemplate);
    }
    
    @Test
    public void sqlSessionRegistered() {
        Assert.assertNotNull(sqlSession);
    }
    
    @Test
    public void transactionManagerRegistered() {
        Assert.assertNotNull(transactionManager);
    }
    
    // TODO test about configurations for mybatis-config.xml(SqlSessionFactory on javaconfig)
}

@@ -35,31 +35,75 @@
 ort 
-javax.sql.DataSour
+com.goree.api.Application;%0Aimport com.goree.api.sample.FooServi
 ce;%0A
-%0A
 impo
@@ -660,71 +660,26 @@
 ort 
-com.goree.api.Application;%0Aimport com.goree.api.sample.FooServi
+javax.sql.DataSour
 ce;%0A
@@ -2030,105 +2030,6 @@
   %7D%0A
-    %0A    // TODO test about configurations for mybatis-config.xml(SqlSessionFactory on javaconfig)%0A
 %7D%0A

remove todo already completed