From 28b7215b0c31a726c5957ae03f613a282bafa7cd Mon Sep 17 00:00:00 2001 From: geek Date: Wed, 9 Aug 2017 12:52:48 +0900 Subject: [PATCH] test import modify --- src/main/resources/database.properties | 2 +- .../apikey/service/ApiKeyServiceTest.java | 6 ++-- .../service/DomainMemberServiceTest.java | 5 ++- .../domain/service/DomainServiceTest.java | 5 ++- .../email/service/EmailAuthServiceTest.java | 5 ++- .../infra/service/InfraHostServiceTest.java | 8 ++--- .../service/InfraMachineServiceTest.java | 8 ++--- .../InfraOSApplicationServiceTest.java | 6 ++-- .../service/InfraOSDaemonServiceTest.java | 6 ++-- .../infra/service/InfraOSPortServiceTest.java | 6 ++-- .../infra/service/InfraOSServiceTest.java | 6 ++-- .../service/InfraServiceServiceTest.java | 7 ++-- .../infra/service/InfraServiceTest.java | 6 ++-- .../module/member/dao/MemberDAOTest.java | 4 +-- .../member/service/MemberServiceTest.java | 6 ++-- .../MetaCrawlerInputItemServiceTest.java | 6 ++-- .../meta/service/MetaCrawlerServiceTest.java | 6 ++-- .../service/MetaInfraTypeServiceTest.java | 6 ++-- .../service/MetaInfraVendorServiceTest.java | 6 ++-- .../service/MetaInputTypeServiceTest.java | 6 ++-- .../service/MetaMemberStatusServiceTest.java | 6 ++-- .../MetaNoAuthProbeStatusServiceTest.java | 6 ++-- .../MetaProbeArchitectureServiceTest.java | 6 ++-- .../meta/service/MetaProbeOsServiceTest.java | 6 ++-- .../service/MetaProbePackageServiceTest.java | 6 ++-- .../service/MetaProbeStatusServiceTest.java | 6 ++-- .../service/MetaProbeTaskTypeServiceTest.java | 6 ++-- .../service/MetaProbeVersionServiceTest.java | 6 ++-- .../service/MetaSensorItemServiceTest.java | 6 ++-- .../MetaSensorItemTypeServiceTest.java | 6 ++-- .../service/MetaSensorStatusServiceTest.java | 6 ++-- .../service/MetaVendorCrawlerServiceTest.java | 6 ++-- .../service/NoAuthProbeServiceTest.java | 5 ++- .../probe/service/ProbeServiceTest.java | 6 ++-- .../probe/service/ProbeTaskServiceTest.java | 5 ++- .../sensor/service/SensorItemServiceTest.java | 6 ++-- .../sensor/service/SensorServiceTest.java | 6 ++-- .../service/TargetDiscoveryServiceTest.java | 9 ++--- .../target/service/TargetServiceTest.java | 8 ++--- .../overflow/proxy/ServiceInvokerTest.java | 29 ++++++++-------- .../loafle/overflow/spring/AppConfigTest.java | 33 +++++++++++-------- 41 files changed, 113 insertions(+), 182 deletions(-) diff --git a/src/main/resources/database.properties b/src/main/resources/database.properties index 0b6c454..69867bd 100644 --- a/src/main/resources/database.properties +++ b/src/main/resources/database.properties @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java b/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java index be07583..49b182d 100644 --- a/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/domain/service/DomainMemberServiceTest.java b/src/test/java/com/loafle/overflow/module/domain/service/DomainMemberServiceTest.java index c1eb3f0..e0e5987 100644 --- a/src/test/java/com/loafle/overflow/module/domain/service/DomainMemberServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/domain/service/DomainMemberServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/domain/service/DomainServiceTest.java b/src/test/java/com/loafle/overflow/module/domain/service/DomainServiceTest.java index 1565997..b9dbe3d 100644 --- a/src/test/java/com/loafle/overflow/module/domain/service/DomainServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/domain/service/DomainServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/email/service/EmailAuthServiceTest.java b/src/test/java/com/loafle/overflow/module/email/service/EmailAuthServiceTest.java index 82b15a7..ee4bdb9 100644 --- a/src/test/java/com/loafle/overflow/module/email/service/EmailAuthServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/email/service/EmailAuthServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraHostServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraHostServiceTest.java index 03f0b36..6bf4993 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraHostServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraHostServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraMachineServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraMachineServiceTest.java index 2f9fcd3..ac58a0f 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraMachineServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraMachineServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSApplicationServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSApplicationServiceTest.java index aee4b1b..7da3bd5 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSApplicationServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSApplicationServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSDaemonServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSDaemonServiceTest.java index 45bb44c..91b825a 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSDaemonServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSDaemonServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSPortServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSPortServiceTest.java index efe25e5..9c7474c 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSPortServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSPortServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSServiceTest.java index 5a2e584..3cf829b 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraOSServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraOSServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceServiceTest.java index e8a5ab7..edc314a 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java index 3c018a2..62062a7 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java b/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java index cfe3c28..97abf32 100644 --- a/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java +++ b/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/member/service/MemberServiceTest.java b/src/test/java/com/loafle/overflow/module/member/service/MemberServiceTest.java index 6bab822..34d33f5 100644 --- a/src/test/java/com/loafle/overflow/module/member/service/MemberServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/member/service/MemberServiceTest.java @@ -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; diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemServiceTest.java index 8cb76ad..9b88e06 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerServiceTest.java index abb11f0..72a0ec0 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraTypeServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraTypeServiceTest.java index f51fbd7..5e4d1f0 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraTypeServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraVendorServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraVendorServiceTest.java index d6cce14..157604a 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraVendorServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraVendorServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaInputTypeServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaInputTypeServiceTest.java index d3c0d7e..19dc053 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaInputTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaInputTypeServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaMemberStatusServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaMemberStatusServiceTest.java index 87911a2..512910c 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaMemberStatusServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaMemberStatusServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusServiceTest.java index b28c2d8..aa26df0 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureServiceTest.java index 45bfb92..c808efc 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeOsServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeOsServiceTest.java index 326f743..b495a0c 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeOsServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeOsServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java index e8c6763..1b41a99 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java index c178729..e3e2e81 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java index 2a5ea1a..3e932cf 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java index 08aa4b1..7d04fe8 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java index fdf31be..2f94964 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemTypeServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemTypeServiceTest.java index 81b050e..b845e48 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemTypeServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java index 5b7ffaf..01b8a50 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java index 92bc5b1..2982603 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeServiceTest.java b/src/test/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeServiceTest.java index 4f53591..9e8e134 100644 --- a/src/test/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java b/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java index 5beafd1..f0a2eac 100644 --- a/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java b/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java index b6ce121..2c436bf 100644 --- a/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/sensor/service/SensorItemServiceTest.java b/src/test/java/com/loafle/overflow/module/sensor/service/SensorItemServiceTest.java index b3da13e..bf1176c 100644 --- a/src/test/java/com/loafle/overflow/module/sensor/service/SensorItemServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/sensor/service/SensorItemServiceTest.java @@ -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; diff --git a/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java b/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java index c4f9e34..376a142 100644 --- a/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java @@ -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; diff --git a/src/test/java/com/loafle/overflow/module/target/service/TargetDiscoveryServiceTest.java b/src/test/java/com/loafle/overflow/module/target/service/TargetDiscoveryServiceTest.java index 6c5a2e1..c868bcf 100644 --- a/src/test/java/com/loafle/overflow/module/target/service/TargetDiscoveryServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/target/service/TargetDiscoveryServiceTest.java @@ -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 diff --git a/src/test/java/com/loafle/overflow/module/target/service/TargetServiceTest.java b/src/test/java/com/loafle/overflow/module/target/service/TargetServiceTest.java index fb0818d..0631b07 100644 --- a/src/test/java/com/loafle/overflow/module/target/service/TargetServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/target/service/TargetServiceTest.java @@ -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; diff --git a/src/test/java/com/loafle/overflow/proxy/ServiceInvokerTest.java b/src/test/java/com/loafle/overflow/proxy/ServiceInvokerTest.java index 2ac2a54..f629c05 100644 --- a/src/test/java/com/loafle/overflow/proxy/ServiceInvokerTest.java +++ b/src/test/java/com/loafle/overflow/proxy/ServiceInvokerTest.java @@ -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 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 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 params2 = new ArrayList<>(1); params2.add(ByteString.copyFromUtf8("1")); diff --git a/src/test/java/com/loafle/overflow/spring/AppConfigTest.java b/src/test/java/com/loafle/overflow/spring/AppConfigTest.java index 258d1c6..d3b9ff8 100644 --- a/src/test/java/com/loafle/overflow/spring/AppConfigTest.java +++ b/src/test/java/com/loafle/overflow/spring/AppConfigTest.java @@ -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; } + } \ No newline at end of file