test import modify
This commit is contained in:
parent
a010985c5e
commit
28b7215b0c
|
@ -1,4 +1,4 @@
|
|||
datasource.url=jdbc:postgresql://192.168.1.209:5432/overflow
|
||||
datasource.url=jdbc:postgresql://192.168.1.51:5432/overflow
|
||||
datasource.username=overflow
|
||||
datasource.password=qwer5795
|
||||
datasource.driver-class-name=org.postgresql.Driver
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.apikey.service;
|
|||
|
||||
import com.loafle.overflow.module.apikey.model.ApiKey;
|
||||
import com.loafle.overflow.module.domain.model.Domain;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 6. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class ApiKeyServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,8 +3,7 @@ package com.loafle.overflow.module.domain.service;
|
|||
import com.loafle.overflow.module.domain.model.Domain;
|
||||
import com.loafle.overflow.module.domain.model.DomainMember;
|
||||
import com.loafle.overflow.module.member.model.Member;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -19,7 +18,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 6. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class DomainMemberServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package com.loafle.overflow.module.domain.service;
|
||||
|
||||
import com.loafle.overflow.module.domain.model.Domain;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -17,7 +16,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 6. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class DomainServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.loafle.overflow.module.email.service;
|
||||
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -15,7 +14,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
|
||||
@Ignore
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class,MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class EmailAuthServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package com.loafle.overflow.module.infra.service;
|
||||
|
||||
import com.loafle.overflow.module.infra.model.InfraHost;
|
||||
|
||||
import com.loafle.overflow.module.infra.model.InfraOS;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -14,11 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
/**
|
||||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraHostServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.loafle.overflow.module.infra.service;
|
||||
|
||||
import com.loafle.overflow.module.infra.model.InfraMachine;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -13,11 +12,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
/**
|
||||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraMachineServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.infra.service;
|
|||
|
||||
import com.loafle.overflow.module.infra.model.InfraOS;
|
||||
import com.loafle.overflow.module.infra.model.InfraOSApplication;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraOSApplicationServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.infra.service;
|
|||
|
||||
import com.loafle.overflow.module.infra.model.InfraOS;
|
||||
import com.loafle.overflow.module.infra.model.InfraOSDaemon;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraOSDaemonServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.infra.service;
|
|||
|
||||
import com.loafle.overflow.module.infra.model.InfraOS;
|
||||
import com.loafle.overflow.module.infra.model.InfraOSPort;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -18,7 +16,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraOSPortServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,9 +3,7 @@ package com.loafle.overflow.module.infra.service;
|
|||
import com.loafle.overflow.module.infra.model.InfraMachine;
|
||||
import com.loafle.overflow.module.infra.model.InfraOS;
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -18,7 +16,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraOSServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,11 +3,8 @@ package com.loafle.overflow.module.infra.service;
|
|||
|
||||
import com.loafle.overflow.module.infra.model.InfraHost;
|
||||
import com.loafle.overflow.module.infra.model.InfraService;
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraType;
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -22,7 +19,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraServiceServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -4,9 +4,7 @@ import com.loafle.overflow.module.infra.model.Infra;
|
|||
import com.loafle.overflow.module.meta.model.MetaInfraType;
|
||||
import com.loafle.overflow.module.probe.model.Probe;
|
||||
import com.loafle.overflow.module.target.model.Target;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -20,7 +18,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class InfraServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -16,10 +16,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
* Created by geek on 17. 6. 28.
|
||||
*/
|
||||
|
||||
//@Ignore
|
||||
@Ignore
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ActiveProfiles("test")
|
||||
@ContextConfiguration(classes = {AppConfig.class, AppConfigTest.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MemberDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.member.service;
|
|||
|
||||
import com.loafle.overflow.module.member.model.Member;
|
||||
import com.loafle.overflow.module.meta.model.MetaMemberStatus;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -19,10 +17,10 @@ import java.util.Date;
|
|||
/**
|
||||
* Created by insanity on 17. 6. 28.
|
||||
*/
|
||||
//@Ignore
|
||||
@Ignore
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ActiveProfiles("test")
|
||||
@ContextConfiguration(classes = {AppConfig.class, AppConfigTest.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MemberServiceTest {
|
||||
@Autowired
|
||||
MemberService memberService;
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.meta.service;
|
|||
|
||||
import com.loafle.overflow.module.meta.model.MetaCrawler;
|
||||
import com.loafle.overflow.module.meta.model.MetaCrawlerInputItem;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaCrawlerInputItemServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaCrawler;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaCrawlerServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraType;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaInfraTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.meta.service;
|
|||
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraType;
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaInfraVendorServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaInputType;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaInputTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaMemberStatus;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaMemberStatusServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaNoAuthProbeStatusServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeArchitecture;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaProbeArchitectureServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeOs;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaProbeOsServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.loafle.overflow.module.meta.service;
|
|||
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeOs;
|
||||
import com.loafle.overflow.module.meta.model.MetaProbePackage;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaProbePackageServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeStatus;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaProbeStatusServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeTaskType;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaProbeTaskTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeVersion;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaProbeVersionServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaSensorItem;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaSensorItemServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaSensorItemType;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaSensorItemTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.loafle.overflow.module.meta.service;
|
||||
|
||||
import com.loafle.overflow.module.meta.model.MetaSensorStatus;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaSensorStatusServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,9 +3,7 @@ package com.loafle.overflow.module.meta.service;
|
|||
import com.loafle.overflow.module.meta.model.MetaCrawler;
|
||||
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
|
||||
import com.loafle.overflow.module.meta.model.MetaVendorCrawler;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -20,7 +18,7 @@ import java.util.List;
|
|||
* Created by snoop on 17. 7. 27.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class MetaVendorCrawlerServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,8 +3,7 @@ package com.loafle.overflow.module.noauthprobe.service;
|
|||
import com.loafle.overflow.module.domain.model.Domain;
|
||||
import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus;
|
||||
import com.loafle.overflow.module.noauthprobe.model.NoAuthProbe;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -21,7 +20,7 @@ import static org.junit.Assert.*;
|
|||
* Created by snoop on 17. 6. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class NoAuthProbeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -5,9 +5,7 @@ import com.loafle.overflow.module.infra.model.InfraHost;
|
|||
import com.loafle.overflow.module.member.model.Member;
|
||||
import com.loafle.overflow.module.meta.model.MetaProbeStatus;
|
||||
import com.loafle.overflow.module.probe.model.Probe;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -22,7 +20,7 @@ import java.util.List;
|
|||
* Created by snoop on 17. 6. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class ProbeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,8 +3,7 @@ package com.loafle.overflow.module.probe.service;
|
|||
import com.loafle.overflow.module.meta.model.MetaProbeTaskType;
|
||||
import com.loafle.overflow.module.probe.model.Probe;
|
||||
import com.loafle.overflow.module.probe.model.ProbeTask;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -19,7 +18,7 @@ import java.util.List;
|
|||
* Created by snoop on 17. 6. 28.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class ProbeTaskServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -3,9 +3,7 @@ package com.loafle.overflow.module.sensor.service;
|
|||
import com.loafle.overflow.module.meta.model.MetaSensorItem;
|
||||
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -24,7 +22,7 @@ import java.util.List;
|
|||
*/
|
||||
@Ignore
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class SensorItemServiceTest {
|
||||
@Autowired
|
||||
SensorItemService sensorItemService;
|
||||
|
|
|
@ -4,9 +4,7 @@ import com.loafle.overflow.module.meta.model.MetaCrawler;
|
|||
import com.loafle.overflow.module.meta.model.MetaSensorStatus;
|
||||
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||
import com.loafle.overflow.module.target.model.Target;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@ -24,7 +22,7 @@ import java.util.List;
|
|||
*/
|
||||
@Ignore
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class SensorServiceTest {
|
||||
@Autowired
|
||||
SensorService sensorService;
|
||||
|
|
|
@ -2,28 +2,23 @@ package com.loafle.overflow.module.target.service;
|
|||
|
||||
import com.loafle.overflow.module.discovery.model.Host;
|
||||
import com.loafle.overflow.module.probe.model.Probe;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.codehaus.jackson.map.DeserializationConfig;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -32,7 +27,7 @@ import java.util.List;
|
|||
*/
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class TargetDiscoveryServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package com.loafle.overflow.module.target.service;
|
||||
|
||||
import com.loafle.overflow.module.infra.model.Infra;
|
||||
import com.loafle.overflow.module.probe.model.Probe;
|
||||
import com.loafle.overflow.module.target.model.Target;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -21,7 +17,7 @@ import java.util.Date;
|
|||
*/
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class TargetServiceTest {
|
||||
@Autowired
|
||||
TargetService targetService;
|
||||
|
|
|
@ -3,9 +3,7 @@ package com.loafle.overflow.proxy;
|
|||
import com.google.common.primitives.Primitives;
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.loafle.overflow.module.target.service.TargetDiscoveryService;
|
||||
import com.loafle.overflow.spring.AppConfig;
|
||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||
import com.loafle.overflow.spring.MailConfiguration;
|
||||
import com.loafle.overflow.spring.AppConfigTest;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -23,26 +21,25 @@ import static org.junit.Assert.*;
|
|||
* Created by crusader on 17. 6. 30.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
|
||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||
public class ServiceInvokerTest {
|
||||
@Autowired
|
||||
private ServiceInvoker serviceInvoker;
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void invoke() throws Exception {
|
||||
|
||||
List<ByteString> params = new ArrayList<>(2);
|
||||
params.add(ByteString.copyFromUtf8("[{\"id\": 1," +
|
||||
"\"ip\":2312132112," +
|
||||
"\"mac\":12312312," +
|
||||
"\"os\": \"Windows\"," +
|
||||
"\"target\":true}]"));
|
||||
params.add(ByteString.copyFromUtf8("{\"id\": 1," +
|
||||
"\"ip\":2312132112," +
|
||||
"\"probeKey\":\"sdfsdfsdfsdfsd\"}"));
|
||||
|
||||
serviceInvoker.invoke("TargetDiscoveryService", "saveAllTarget", params);
|
||||
// List<ByteString> params = new ArrayList<>(2);
|
||||
// params.add(ByteString.copyFromUtf8("[{\"id\": 1," +
|
||||
// "\"ip\":2312132112," +
|
||||
// "\"mac\":12312312," +
|
||||
// "\"os\": \"Windows\"," +
|
||||
// "\"target\":true}]"));
|
||||
// params.add(ByteString.copyFromUtf8("{\"id\": 1," +
|
||||
// "\"ip\":2312132112," +
|
||||
// "\"probeKey\":\"sdfsdfsdfsdfsd\"}"));
|
||||
//
|
||||
// serviceInvoker.invoke("TargetDiscoveryService", "saveAllTarget", params);
|
||||
|
||||
List<ByteString> params2 = new ArrayList<>(1);
|
||||
params2.add(ByteString.copyFromUtf8("1"));
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package com.loafle.overflow.spring;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
|
||||
import org.springframework.context.annotation.*;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
@ -14,16 +13,22 @@ import static org.junit.Assert.*;
|
|||
* Created by geek on 17. 8. 8.
|
||||
*/
|
||||
@Configuration
|
||||
@Profile("test")
|
||||
@ComponentScan(basePackages = {"com.loafle.overflow"}, excludeFilters = @ComponentScan.Filter({Configuration.class}))
|
||||
@Import({JdbcConfiguration.class, MailConfiguration.class})
|
||||
@TestPropertySource({"classpath:database.properties","classpath:mail.properties"})
|
||||
public class AppConfigTest {
|
||||
|
||||
@Autowired
|
||||
private DataSource configureDataSource;
|
||||
|
||||
@Bean
|
||||
public JdbcTemplate jdbcTemplate() {
|
||||
JdbcTemplate template = new JdbcTemplate();
|
||||
template.setDataSource(configureDataSource);
|
||||
return template;
|
||||
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
|
||||
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
|
||||
// ppc.setLocation(new ClassPathResource("database.properties"));
|
||||
ppc.setLocations(new Resource[] {
|
||||
new ClassPathResource("database.properties"),
|
||||
new ClassPathResource("mail.properties")
|
||||
});
|
||||
ppc.setIgnoreUnresolvablePlaceholders(true);
|
||||
|
||||
return ppc;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user