From 47bacb0629892ccf1d0c43b6cd8b74981743ca47 Mon Sep 17 00:00:00 2001 From: snoop Date: Fri, 23 Jun 2017 14:35:41 +0900 Subject: [PATCH] added test --- .../overflow/module/domain/dao/DomainDAOTest.java | 3 ++- .../noauthprobe/dao/NoAuthProbeDAOTest.java | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java b/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java index f4b26c3..e3b24f3 100644 --- a/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java +++ b/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java @@ -3,6 +3,7 @@ package com.loafle.overflow.module.domain.dao; import com.loafle.overflow.AppConfig; import com.loafle.overflow.JdbcConfiguration; import com.loafle.overflow.module.domain.Domain; +import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -28,12 +29,12 @@ public class DomainDAOTest { Domain domain = new Domain(); - domain.setCreateDate(new Date()); domain.setName("snoop's domain"); this.domainDAO.save(domain); + Assert.assertNotEquals(domain.getId(), 0); } } \ No newline at end of file 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 f8e10e4..6901ffa 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 @@ -30,8 +30,13 @@ public class NoAuthProbeDAOTest { @Test public void testFindTempKey() { + NoAuthProbe probe = this.noAuthProbeDAO.findByTempKey("1cf2555c57d511e79714080027658d13"); + Assert.assertNotEquals(probe, null); + + System.out.println(probe.getTempProbeKey()); + } // @Ignore @@ -40,18 +45,18 @@ public class NoAuthProbeDAOTest { NoAuthProbe noAuthProbe = new NoAuthProbe(); - noAuthProbe.setApiKey("11111111111111"); + noAuthProbe.setHostName("snooop"); - noAuthProbe.setIpAddress(44444); - noAuthProbe.setMacAddress(222222); + noAuthProbe.setIpAddress(3232235980L); + noAuthProbe.setMacAddress(8796753988883L); noAuthProbe.setStatus(AuthType.PROCESS); - noAuthProbe.setTempProbeKey("4444"); + noAuthProbe.setTempProbeKey("1cf2555c57d511e79714080027658d13"); Domain d = new Domain(); d.setId(1); noAuthProbe.setDomain(d); - System.out.println(noAuthProbe.getId()); + this.noAuthProbeDAO.save(noAuthProbe); Assert.assertNotEquals(noAuthProbe.getId(), 0);