diff --git a/src/main/java/com/loafle/overflow/module/meta/dao/MetaCrawlerInputItemDAO.java b/src/main/java/com/loafle/overflow/module/meta/dao/MetaCrawlerInputItemDAO.java index cf7fe2a..6df44b7 100644 --- a/src/main/java/com/loafle/overflow/module/meta/dao/MetaCrawlerInputItemDAO.java +++ b/src/main/java/com/loafle/overflow/module/meta/dao/MetaCrawlerInputItemDAO.java @@ -1,13 +1,17 @@ package com.loafle.overflow.module.meta.dao; +import com.loafle.overflow.module.meta.model.MetaCrawler; import com.loafle.overflow.module.meta.model.MetaCrawlerInputItem; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + /** * Created by insanity on 17. 6. 23. */ @Repository public interface MetaCrawlerInputItemDAO extends JpaRepository { + List findAllByMetaCrawler(MetaCrawler metaCrawler); } diff --git a/src/main/java/com/loafle/overflow/module/meta/dao/MetaInfraVendorDAO.java b/src/main/java/com/loafle/overflow/module/meta/dao/MetaInfraVendorDAO.java index d8771d3..4ad4e25 100644 --- a/src/main/java/com/loafle/overflow/module/meta/dao/MetaInfraVendorDAO.java +++ b/src/main/java/com/loafle/overflow/module/meta/dao/MetaInfraVendorDAO.java @@ -1,13 +1,17 @@ package com.loafle.overflow.module.meta.dao; +import com.loafle.overflow.module.meta.model.MetaInfraType; import com.loafle.overflow.module.meta.model.MetaInfraVendor; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + /** * Created by insanity on 17. 6. 23. */ @Repository public interface MetaInfraVendorDAO extends JpaRepository { + List findAllByMetaInfraType(MetaInfraType infraType); } diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemService.java new file mode 100644 index 0000000..999da74 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemService.java @@ -0,0 +1,24 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaCrawlerInputItemDAO; +import com.loafle.overflow.module.meta.model.MetaCrawler; +import com.loafle.overflow.module.meta.model.MetaCrawlerInputItem; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaCrawlerInputItemService") +public class MetaCrawlerInputItemService { + + @Autowired + private MetaCrawlerInputItemDAO crawlerInputItemDAO; + + public List readAllByMetaCrawler(MetaCrawler metaCrawler) { + return this.crawlerInputItemDAO.findAllByMetaCrawler(metaCrawler); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaInfraTypeService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaInfraTypeService.java new file mode 100644 index 0000000..32c0dd5 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaInfraTypeService.java @@ -0,0 +1,22 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaInfraTypeDAO; +import com.loafle.overflow.module.meta.model.MetaInfraType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaInfraTypeService") +public class MetaInfraTypeService { + + @Autowired + private MetaInfraTypeDAO infraTypeDAO; + + public List readAll() { + return this.infraTypeDAO.findAll(); + } +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaInfraVendorService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaInfraVendorService.java new file mode 100644 index 0000000..a7c62a2 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaInfraVendorService.java @@ -0,0 +1,24 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaInfraVendorDAO; +import com.loafle.overflow.module.meta.model.MetaInfraType; +import com.loafle.overflow.module.meta.model.MetaInfraVendor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaInfraVendorService") +public class MetaInfraVendorService { + + @Autowired + private MetaInfraVendorDAO infraVendorDAO; + + public List readAllByMetaInfraType(MetaInfraType infraType) { + return this.infraVendorDAO.findAllByMetaInfraType(infraType); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaInputTypeService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaInputTypeService.java new file mode 100644 index 0000000..dd01b6e --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaInputTypeService.java @@ -0,0 +1,23 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaInputTypeDAO; +import com.loafle.overflow.module.meta.model.MetaInputType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaInputTypeService") +public class MetaInputTypeService { + + @Autowired + private MetaInputTypeDAO inputTypeDAO; + + public List readAll() { + return this.inputTypeDAO.findAll(); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaMemberStatusService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaMemberStatusService.java new file mode 100644 index 0000000..6cfe00e --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaMemberStatusService.java @@ -0,0 +1,23 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaMemberStatusDAO; +import com.loafle.overflow.module.meta.model.MetaMemberStatus; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaMemberStatusService") +public class MetaMemberStatusService { + + @Autowired + private MetaMemberStatusDAO memberStatusDAO; + + public List readAll() { + return this.memberStatusDAO.findAll(); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusService.java new file mode 100644 index 0000000..81579be --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusService.java @@ -0,0 +1,21 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaNoAuthProbeStatusDAO; +import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaNoAuthProbeStatusService") +public class MetaNoAuthProbeStatusService { + @Autowired + private MetaNoAuthProbeStatusDAO noAuthProbeStatusDAO; + + public List readAll() { + return this.noAuthProbeStatusDAO.findAll(); + } +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureService.java new file mode 100644 index 0000000..877ce15 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureService.java @@ -0,0 +1,23 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaProbeArchitectureDAO; +import com.loafle.overflow.module.meta.model.MetaProbeArchitecture; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaProbeArchitectureService") +public class MetaProbeArchitectureService { + + @Autowired + private MetaProbeArchitectureDAO probeArchitectureDAO; + + public List readAll() { + return this.probeArchitectureDAO.findAll(); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeOsService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeOsService.java new file mode 100644 index 0000000..8d0bc20 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeOsService.java @@ -0,0 +1,23 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaProbeOsDAO; +import com.loafle.overflow.module.meta.model.MetaProbeOs; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaProbeOsService") +public class MetaProbeOsService { + + @Autowired + private MetaProbeOsDAO probeOsDAO; + + public List readAll() { + return this.probeOsDAO.findAll(); + } + +} 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 new file mode 100644 index 0000000..8cb76ad --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaCrawlerInputItemServiceTest.java @@ -0,0 +1,41 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaCrawlerInputItemServiceTest { + + @Autowired + private MetaCrawlerInputItemService crawlerInputItemService; + + @Test + public void readAllByMetaCrawler() throws Exception { + + MetaCrawler metaCrawler = new MetaCrawler(); + metaCrawler.setId((short)1); + + List crawlerInputItems = this.crawlerInputItemService.readAllByMetaCrawler(metaCrawler); + + Assert.assertNotEquals(crawlerInputItems.size(), 0); + + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..f51fbd7 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraTypeServiceTest.java @@ -0,0 +1,37 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaInfraTypeServiceTest { + + @Autowired + private MetaInfraTypeService infraTypeService; + + @Test + public void readAll() throws Exception { + + List metaInfraTypes = this.infraTypeService.readAll(); + + Assert.assertNotEquals(metaInfraTypes.size(), 0); + + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..d6cce14 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaInfraVendorServiceTest.java @@ -0,0 +1,40 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaInfraVendorServiceTest { + + @Autowired + private MetaInfraVendorService infraVendorService; + + @Test + public void readAllByMetaInfraType() throws Exception { + + MetaInfraType metaInfraType = new MetaInfraType(); + metaInfraType.setId(1); + + List infraVendors = this.infraVendorService.readAllByMetaInfraType(metaInfraType); + + Assert.assertNotEquals(infraVendors.size(), 0); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..d3c0d7e --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaInputTypeServiceTest.java @@ -0,0 +1,37 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaInputTypeServiceTest { + + @Autowired + private MetaInputTypeService inputTypeService; + + @Test + public void readAll() throws Exception { + + List inputTypes = this.inputTypeService.readAll(); + + Assert.assertNotEquals(inputTypes.size(), 0); + + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..87911a2 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaMemberStatusServiceTest.java @@ -0,0 +1,37 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaMemberStatusServiceTest { + + @Autowired + private MetaMemberStatusService memberStatusService; + + @Test + public void readAll() throws Exception { + + List memberStatuses = this.memberStatusService.readAll(); + + Assert.assertNotEquals(memberStatuses.size(), 0); + + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..b28c2d8 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaNoAuthProbeStatusServiceTest.java @@ -0,0 +1,35 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaNoAuthProbeStatusServiceTest { + + @Autowired + private MetaNoAuthProbeStatusService noAuthProbeStatusService; + + @Test + public void readAll() throws Exception { + List metaNoAuthProbeStatuses = this.noAuthProbeStatusService.readAll(); + + Assert.assertNotEquals(metaNoAuthProbeStatuses.size(), 0); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..45bfb92 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeArchitectureServiceTest.java @@ -0,0 +1,36 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaProbeArchitectureServiceTest { + + @Autowired + private MetaProbeArchitectureService probeArchitectureService; + + @Test + public void readAll() throws Exception { + + List probeArchitectures = this.probeArchitectureService.readAll(); + + Assert.assertNotEquals(probeArchitectures.size(), 0); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000..326f743 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeOsServiceTest.java @@ -0,0 +1,37 @@ +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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaProbeOsServiceTest { + + @Autowired + private MetaProbeOsService probeOsService; + + @Test + public void readAll() throws Exception { + + List metaProbeOs = this.probeOsService.readAll(); + + Assert.assertNotEquals(metaProbeOs.size(), 0); + + } + +} \ No newline at end of file