fixing noauthprobe
This commit is contained in:
parent
86a8ee756d
commit
7b7bd1a540
|
@ -72,10 +72,16 @@ public class NoAuthProbeService {
|
|||
Map<String, Object> objMap = null;
|
||||
objMap = this.objectMapper.readValue(noAuth.getDescription(), new TypeReference<HashMap<String,Object>>() {});
|
||||
|
||||
Map<String, String> hostMap = null;
|
||||
Map<String, String> netMap = null;
|
||||
|
||||
hostMap = (Map<String, String>)objMap.get("host");
|
||||
netMap = (Map<String, String>)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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<NoAuthProbe> noAuthProbes = new ArrayList<>();
|
||||
noAuthProbes.add(noAuthProbe);
|
||||
|
||||
this.noAuthProbeService.acceptNoAuthProbes(noAuthProbes);
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user