email token duplication check

This commit is contained in:
geek 2018-06-28 20:10:15 +09:00
parent 3fbc080d70
commit c4c3f94a69
3 changed files with 87 additions and 5 deletions

View File

@ -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<MetaDisplayItemCategory> 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<MetaDisplayItemCategory> registAll(List<MetaDisplayItemCategory> metaDisplayItemCategories)
throws OverflowException {
return null;
return this.metaDisplayItemCategoryDAO.saveAll(metaDisplayItemCategories);
}
}

View File

@ -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<MetaCollectionItem> 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

View File

@ -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<MetaCrawlerMapping> mappings = this.metaCrawlerMappingService.readAll();
System.out.println(mappings.size());
Assert.assertNotNull(mappings);
}
@Test
public void readAllByMetaTargetTypeID() throws OverflowException {
List<MetaCrawlerMapping> mappings = this.metaCrawlerMappingService.readAllByMetaTargetTypeID(100);
System.out.println(mappings.size());
Assert.assertNotNull(mappings);
}
@Test
public void readAllByMetaTargetTypeKey() throws OverflowException {
List<MetaCrawlerMapping> mappings = this.metaCrawlerMappingService.readAllByMetaTargetTypeKey("ALPINE_LINUX");
System.out.println(mappings.size());
Assert.assertNotNull(mappings);
}
@Test
public void regist() throws OverflowException {
}
}