email token duplication check

This commit is contained in:
geek 2018-06-29 15:04:26 +09:00
parent f4d4544fbc
commit 75cd0da04e
3 changed files with 99 additions and 1 deletions

View File

@ -231,6 +231,10 @@ INSERT INTO public.infra
(infra_type,meta_infra_type_id,probe_id)
VALUES
(3, 3, 3);
INSERT INTO public.infra
(infra_type,meta_infra_type_id,probe_id)
VALUES
(3, 3, 3);
INSERT INTO public.infra_zone
("address", iface, mac, network, id, meta_ip_type_id, meta_target_zone_type_id)
@ -544,7 +548,10 @@ INSERT INTO public.infra_service
(id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id)
VALUES
(27, NULL, 16, 1, 1014);
INSERT INTO public.infra_service
(id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id)
VALUES
(28, NULL, 17, 17, 1047);
INSERT INTO public.target

View File

@ -6,6 +6,7 @@ import com.loafle.overflow.model.discovery.Host;
import com.loafle.overflow.model.discovery.Port;
import com.loafle.overflow.model.discovery.Service;
import com.loafle.overflow.model.discovery.Zone;
import com.loafle.overflow.model.infra.Infra;
import com.loafle.overflow.model.meta.MetaCryptoType;
import com.loafle.overflow.model.meta.MetaIPType;
import com.loafle.overflow.model.meta.MetaPortType;
@ -105,4 +106,60 @@ public class CentralInfraServiceTest {
@Test
public void readAllInfraByProbeID() {
}
@Test
public void registByZone() {
}
@Test
public void registByHost() {
}
// Long probeID,
// com.loafle.overflow.model.discovery.Service service
@Test
public void registByService() throws OverflowException {
Host host = null;
Service service = null;
Port port = null;
MetaCryptoType cryptoType = null;
Zone zone = new Zone();
zone.setAddress("192.168.1.103/24");
zone.setDiscoveredDate(new Date());
zone.setIface("enp3s0");
zone.setMac("44:8a:5b:44:8c:e8");
zone.setMetaIPType(MetaIPType.Enum.V4.to());
zone.setNetwork("192.168.1.0/24");
host = new Host();
host.setMetaIPType(MetaIPType.Enum.V4.to());
host.getMetaIPType().setKey("V4");
host.setAddress("192.168.1.103");
host.setMac("44:8a:5b:44:8c:e8");
host.setDiscoveredDate(new Date());
host.setZone(zone);
port = new Port();
port.setDiscoveredDate(new Date());
port.setHost(host);
port.setMetaPortType(MetaPortType.Enum.TCP.to());
port.setPortNumber(22);
service = new Service();
cryptoType = new MetaCryptoType();
cryptoType.setKey("TLS");
cryptoType.setId(Short.valueOf((short) 17));
cryptoType.setName("TLS");
service.setMetaCryptoType(cryptoType);
service.setPort(port);
service.setDiscoveredDate(new Date());
service.setKey("SSH");
com.loafle.overflow.model.infra.InfraService in = this.infraService.registByService(Long.valueOf(3), service);
System.out.println(in);
}
}

View File

@ -0,0 +1,34 @@
package com.loafle.overflow.central.module.meta.service;
import com.loafle.overflow.central.spring.AppConfigTest;
import com.loafle.overflow.model.meta.MetaDisplayItemMapping;
import com.loafle.overflow.service.central.meta.MetaDisplayItemMappingService;
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 static org.junit.Assert.*;
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test")
@ContextConfiguration(classes = {AppConfigTest.class})
public class CentralMetaDisplayItemMappingServiceTest {
@Autowired
private MetaDisplayItemMappingService metaDisplayItemMappingService;
@Test
public void readAllByMetaDisplayItemID() {
}
@Test
public void readAllByMetaCrawlerMappingID() {
}
@Test
public void readAll() {
}
}