probe task
This commit is contained in:
snoop 2017-06-26 16:30:28 +09:00
parent d5e6841bb9
commit 1043cd3d04
2 changed files with 25 additions and 0 deletions

View File

@ -1,12 +1,17 @@
package com.loafle.overflow.module.probe.dao;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.probe.model.ProbeTask;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by snoop on 17. 6. 26.
*/
@Repository
public interface ProbeTaskDAO extends JpaRepository<ProbeTask, Long> {
List<ProbeTask> findAllByProbe(Probe probe);
}

View File

@ -5,12 +5,16 @@ import com.loafle.overflow.JdbcConfiguration;
import com.loafle.overflow.meta.model.MetaProbeTaskType;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.probe.model.ProbeTask;
import org.junit.Assert;
import org.junit.Ignore;
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 java.util.List;
import static org.junit.Assert.*;
/**
@ -24,6 +28,7 @@ public class ProbeTaskDAOTest {
private ProbeTaskDAO probeTaskDAO;
@Ignore
@Test
public void Create() {
@ -42,7 +47,22 @@ public class ProbeTaskDAOTest {
this.probeTaskDAO.save(probeTask);
}
@Ignore
@Test
public void select() {
Create();
Probe probe = new Probe();
probe.setId(1);
List<ProbeTask> probeTasks = this.probeTaskDAO.findAllByProbe(probe);
Assert.assertNotEquals(probeTasks.size(), 0 );
}
}