test
This commit is contained in:
snoop 2017-06-23 15:51:17 +09:00
parent a21826dd10
commit fb1d644c2d
2 changed files with 48 additions and 2 deletions

View File

@ -51,7 +51,7 @@ public class NoAuthProbeDAOTest {
noAuthProbe.setHostName("snooop"); noAuthProbe.setHostName("snooop");
noAuthProbe.setIpAddress(3232235980L); noAuthProbe.setIpAddress(3232235980L);
noAuthProbe.setMacAddress(8796753988883L); noAuthProbe.setMacAddress(8796753988883L);
noAuthProbe.setStatus(AuthType.PROCESS); noAuthProbe.setStatus(AuthType.P);
noAuthProbe.setTempProbeKey("1cf2555c57d511e79714080027658d13"); noAuthProbe.setTempProbeKey("1cf2555c57d511e79714080027658d13");
Domain d = new Domain(); Domain d = new Domain();
@ -69,7 +69,7 @@ public class NoAuthProbeDAOTest {
NoAuthProbe probe = this.noAuthProbeDAO.findByTempKey("1cf2555c57d511e79714080027658d13"); NoAuthProbe probe = this.noAuthProbeDAO.findByTempKey("1cf2555c57d511e79714080027658d13");
probe.setStatus(AuthType.ACCEPT); probe.setStatus(AuthType.A);
this.noAuthProbeDAO.save(probe); this.noAuthProbeDAO.save(probe);

View File

@ -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);
}
}