From c4c3f94a69eb9451267e5ba37fc10778b0b452b1 Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 28 Jun 2018 20:10:15 +0900 Subject: [PATCH] email token duplication check --- ...CentralMetaDisplayItemCategoryService.java | 11 ++-- .../CentralMetaCollectionItemServiceTest.java | 28 +++++++++- .../CentralMetaCrawlerMappingServiceTest.java | 53 +++++++++++++++++++ 3 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingServiceTest.java diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemCategoryService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemCategoryService.java index 1cb4919..d14d220 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemCategoryService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemCategoryService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.central.module.meta.dao.MetaDisplayItemCategoryDAO; import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.model.meta.MetaDisplayItemCategory; import com.loafle.overflow.service.central.meta.MetaDisplayItemCategoryService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @@ -14,20 +16,23 @@ import java.util.List; @Service("MetaDisplayItemCategoryService") public class CentralMetaDisplayItemCategoryService implements MetaDisplayItemCategoryService { + @Autowired + private MetaDisplayItemCategoryDAO metaDisplayItemCategoryDAO; + @Override public List readAll() throws OverflowException { - return null; + return this.metaDisplayItemCategoryDAO.findAll(); } @Override public MetaDisplayItemCategory regist(MetaDisplayItemCategory metaDisplayItemCategory) throws OverflowException { - return null; + return this.metaDisplayItemCategoryDAO.save(metaDisplayItemCategory); } @Override public List registAll(List metaDisplayItemCategories) throws OverflowException { - return null; + return this.metaDisplayItemCategoryDAO.saveAll(metaDisplayItemCategories); } } diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemServiceTest.java index 27a28e7..dc45106 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemServiceTest.java @@ -1,17 +1,41 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.central.spring.AppConfigTest; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaCollectionItem; +import com.loafle.overflow.service.central.meta.MetaCollectionItemService; +import org.junit.Ignore; import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.util.Assert; + +import java.util.List; import static org.junit.Assert.*; +@RunWith(SpringJUnit4ClassRunner.class) +@ActiveProfiles("test") +@ContextConfiguration(classes = {AppConfigTest.class}) +@Ignore public class CentralMetaCollectionItemServiceTest { + @Autowired + private MetaCollectionItemService metaCollectionItemService; + @Test - public void readAll() { + public void readAll() throws OverflowException { + List items = this.metaCollectionItemService.readAll(); + org.junit.Assert.assertNotNull(items); } @Test - public void readByKey() { + public void readByKey() throws OverflowException { + MetaCollectionItem item = this.metaCollectionItemService.readByKey("SERVICE_RESPONSE_TIME"); + org.junit.Assert.assertNotNull(item); } @Test diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingServiceTest.java new file mode 100644 index 0000000..a53862c --- /dev/null +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingServiceTest.java @@ -0,0 +1,53 @@ +package com.loafle.overflow.central.module.meta.service; + +import com.loafle.overflow.central.spring.AppConfigTest; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaCrawlerMapping; +import com.loafle.overflow.service.central.meta.MetaCrawlerMappingService; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; + +import static org.junit.Assert.*; + +@RunWith(SpringJUnit4ClassRunner.class) +@ActiveProfiles("test") +@ContextConfiguration(classes = {AppConfigTest.class}) +@Ignore +public class CentralMetaCrawlerMappingServiceTest { + + @Autowired + MetaCrawlerMappingService metaCrawlerMappingService; + + @Test + public void readAll() throws OverflowException { + List mappings = this.metaCrawlerMappingService.readAll(); + System.out.println(mappings.size()); + Assert.assertNotNull(mappings); + } + + @Test + public void readAllByMetaTargetTypeID() throws OverflowException { + List mappings = this.metaCrawlerMappingService.readAllByMetaTargetTypeID(100); + System.out.println(mappings.size()); + Assert.assertNotNull(mappings); + } + + @Test + public void readAllByMetaTargetTypeKey() throws OverflowException { + List mappings = this.metaCrawlerMappingService.readAllByMetaTargetTypeKey("ALPINE_LINUX"); + System.out.println(mappings.size()); + Assert.assertNotNull(mappings); + } + + @Test + public void regist() throws OverflowException { + } +}