package com.goree.api.sample;

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.test.context.junit4.SpringJUnit4ClassRunner;

import com.goree.api.Application;

@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;
    
    @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);
    }
}

@@ -1718,10 +1718,90 @@
 ;%0A    %7D%0A
+    %0A    // TODO mybatis-config.xml %EE%B0%A1  , sqlSessionFactoryBean %EE%B0%A1 %E9%BF%A1  %D7%BD%C6%AE%CC%BD  %DA%B5 %DB%BC %CA%BF.%0A
 %7D%0A

add TODO