diff --git a/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java b/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java index bd3d0fa..5fc9f74 100644 --- a/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java +++ b/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java @@ -72,10 +72,16 @@ public class NoAuthProbeService { Map objMap = null; objMap = this.objectMapper.readValue(noAuth.getDescription(), new TypeReference>() {}); + Map hostMap = null; + Map netMap = null; + + hostMap = (Map)objMap.get("host"); + netMap = (Map)objMap.get("network"); // String dispName = noAuth.getHostName().isEmpty() ? // StringConvertor.intToIp(noAuth.getIpAddress()) : noAuth.getHostName(); - String dispName = noAuth.getDescription(); + String dispName = hostMap.get("name"); + dispName += " probe"; probe.setDisplayName(dispName); probes.add(probe); diff --git a/src/main/java/com/loafle/overflow/module/probe/model/Probe.java b/src/main/java/com/loafle/overflow/module/probe/model/Probe.java index 9a77877..59c84d8 100644 --- a/src/main/java/com/loafle/overflow/module/probe/model/Probe.java +++ b/src/main/java/com/loafle/overflow/module/probe/model/Probe.java @@ -98,7 +98,7 @@ public class Probe { } - @Column(name = "ENCRYPTION_KEY", nullable = false, length = 50, unique = true) + @Column(name = "ENCRYPTION_KEY", nullable = false, length = 100, unique = true) public String getEncryptionKey() { return encryptionKey; } 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 41789a9..e2ddb94 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 @@ -12,11 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; - /** * Created by snoop on 17. 6. 28. */ @@ -103,7 +102,7 @@ public class NoAuthProbeServiceTest { } - @Ignore +// @Ignore @Test public void read() throws Exception { @@ -112,4 +111,17 @@ public class NoAuthProbeServiceTest { Assert.assertNotEquals(noAuthProbe, null); } + + @Test + public void acceptProbe() throws IOException { + + NoAuthProbe noAuthProbe = this.noAuthProbeService.read(1); + + List noAuthProbes = new ArrayList<>(); + noAuthProbes.add(noAuthProbe); + + this.noAuthProbeService.acceptNoAuthProbes(noAuthProbes); + + } + } \ No newline at end of file