diff --git a/src/test/java/com/loafle/overflow/spring/AppConfigTest.java b/src/test/java/com/loafle/overflow/spring/AppConfigTest.java new file mode 100644 index 0000000..79afa3a --- /dev/null +++ b/src/test/java/com/loafle/overflow/spring/AppConfigTest.java @@ -0,0 +1,36 @@ +package com.loafle.overflow.spring; + +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import javax.sql.DataSource; + +import static org.junit.Assert.*; + +/** + * Created by geek on 17. 8. 8. + */ +@Configuration +@Profile("test") +public class AppConfigTest { + + @Autowired + private DataSource configureDataSource; + + @Bean + public JdbcTemplate jdbcTemplate() { + JdbcTemplate template = new JdbcTemplate(); + template.setDataSource(configureDataSource); + return template; + } +} \ No newline at end of file