diff --git a/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java b/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java index 0417c8b..261af22 100644 --- a/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java +++ b/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java @@ -51,7 +51,7 @@ public class NoAuthProbeDAOTest { noAuthProbe.setHostName("snooop"); noAuthProbe.setIpAddress(3232235980L); noAuthProbe.setMacAddress(8796753988883L); - noAuthProbe.setStatus(AuthType.PROCESS); + noAuthProbe.setStatus(AuthType.P); noAuthProbe.setTempProbeKey("1cf2555c57d511e79714080027658d13"); Domain d = new Domain(); @@ -69,7 +69,7 @@ public class NoAuthProbeDAOTest { NoAuthProbe probe = this.noAuthProbeDAO.findByTempKey("1cf2555c57d511e79714080027658d13"); - probe.setStatus(AuthType.ACCEPT); + probe.setStatus(AuthType.A); this.noAuthProbeDAO.save(probe); diff --git a/src/test/java/com/loafle/overflow/module/probe/dao/ProbeDAOTest.java b/src/test/java/com/loafle/overflow/module/probe/dao/ProbeDAOTest.java new file mode 100644 index 0000000..ebe46ac --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/probe/dao/ProbeDAOTest.java @@ -0,0 +1,46 @@ +package com.loafle.overflow.module.probe.dao; + +import com.loafle.overflow.AppConfig; +import com.loafle.overflow.JdbcConfiguration; +import com.loafle.overflow.module.domain.Domain; +import com.loafle.overflow.module.probe.model.Probe; +import com.loafle.overflow.module.probe.type.ProbeStatusType; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.junit.Assert.*; + +/** + * Created by root on 17. 6. 23. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) +public class ProbeDAOTest { + + @Autowired + private ProbeDAO probeDAO; + + @Test + public void create() { + + Probe probe = new Probe(); + + + probe.setDescription("test probe"); + + Domain domain = new Domain(); + domain.setId(1); + + probe.setDomain(domain); + + probe.setEncryptionKey("9c8d41ab57de11e7a2c9080027658d13"); + probe.setProbeKey("a1e1710557de11e78799080027658d13"); + probe.setStatus(ProbeStatusType.I); + + this.probeDAO.save(probe); + + } +} \ No newline at end of file