added
test
This commit is contained in:
parent
b9c856cb37
commit
47bacb0629
|
@ -3,6 +3,7 @@ package com.loafle.overflow.module.domain.dao;
|
||||||
import com.loafle.overflow.AppConfig;
|
import com.loafle.overflow.AppConfig;
|
||||||
import com.loafle.overflow.JdbcConfiguration;
|
import com.loafle.overflow.JdbcConfiguration;
|
||||||
import com.loafle.overflow.module.domain.Domain;
|
import com.loafle.overflow.module.domain.Domain;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -28,12 +29,12 @@ public class DomainDAOTest {
|
||||||
|
|
||||||
Domain domain = new Domain();
|
Domain domain = new Domain();
|
||||||
|
|
||||||
domain.setCreateDate(new Date());
|
|
||||||
domain.setName("snoop's domain");
|
domain.setName("snoop's domain");
|
||||||
|
|
||||||
this.domainDAO.save(domain);
|
this.domainDAO.save(domain);
|
||||||
|
|
||||||
|
|
||||||
|
Assert.assertNotEquals(domain.getId(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -30,8 +30,13 @@ public class NoAuthProbeDAOTest {
|
||||||
@Test
|
@Test
|
||||||
public void testFindTempKey() {
|
public void testFindTempKey() {
|
||||||
|
|
||||||
|
NoAuthProbe probe = this.noAuthProbeDAO.findByTempKey("1cf2555c57d511e79714080027658d13");
|
||||||
|
|
||||||
|
|
||||||
|
Assert.assertNotEquals(probe, null);
|
||||||
|
|
||||||
|
System.out.println(probe.getTempProbeKey());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Ignore
|
// @Ignore
|
||||||
|
@ -40,18 +45,18 @@ public class NoAuthProbeDAOTest {
|
||||||
|
|
||||||
NoAuthProbe noAuthProbe = new NoAuthProbe();
|
NoAuthProbe noAuthProbe = new NoAuthProbe();
|
||||||
|
|
||||||
noAuthProbe.setApiKey("11111111111111");
|
|
||||||
noAuthProbe.setHostName("snooop");
|
noAuthProbe.setHostName("snooop");
|
||||||
noAuthProbe.setIpAddress(44444);
|
noAuthProbe.setIpAddress(3232235980L);
|
||||||
noAuthProbe.setMacAddress(222222);
|
noAuthProbe.setMacAddress(8796753988883L);
|
||||||
noAuthProbe.setStatus(AuthType.PROCESS);
|
noAuthProbe.setStatus(AuthType.PROCESS);
|
||||||
noAuthProbe.setTempProbeKey("4444");
|
noAuthProbe.setTempProbeKey("1cf2555c57d511e79714080027658d13");
|
||||||
|
|
||||||
Domain d = new Domain();
|
Domain d = new Domain();
|
||||||
d.setId(1);
|
d.setId(1);
|
||||||
noAuthProbe.setDomain(d);
|
noAuthProbe.setDomain(d);
|
||||||
|
|
||||||
System.out.println(noAuthProbe.getId());
|
this.noAuthProbeDAO.save(noAuthProbe);
|
||||||
|
|
||||||
Assert.assertNotEquals(noAuthProbe.getId(), 0);
|
Assert.assertNotEquals(noAuthProbe.getId(), 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user