added
probe task
This commit is contained in:
parent
d5e6841bb9
commit
1043cd3d04
|
@ -1,12 +1,17 @@
|
||||||
package com.loafle.overflow.module.probe.dao;
|
package com.loafle.overflow.module.probe.dao;
|
||||||
|
|
||||||
|
import com.loafle.overflow.module.probe.model.Probe;
|
||||||
import com.loafle.overflow.module.probe.model.ProbeTask;
|
import com.loafle.overflow.module.probe.model.ProbeTask;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by snoop on 17. 6. 26.
|
* Created by snoop on 17. 6. 26.
|
||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface ProbeTaskDAO extends JpaRepository<ProbeTask, Long> {
|
public interface ProbeTaskDAO extends JpaRepository<ProbeTask, Long> {
|
||||||
|
|
||||||
|
List<ProbeTask> findAllByProbe(Probe probe);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,16 @@ import com.loafle.overflow.JdbcConfiguration;
|
||||||
import com.loafle.overflow.meta.model.MetaProbeTaskType;
|
import com.loafle.overflow.meta.model.MetaProbeTaskType;
|
||||||
import com.loafle.overflow.module.probe.model.Probe;
|
import com.loafle.overflow.module.probe.model.Probe;
|
||||||
import com.loafle.overflow.module.probe.model.ProbeTask;
|
import com.loafle.overflow.module.probe.model.ProbeTask;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Ignore;
|
||||||
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;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,6 +28,7 @@ public class ProbeTaskDAOTest {
|
||||||
private ProbeTaskDAO probeTaskDAO;
|
private ProbeTaskDAO probeTaskDAO;
|
||||||
|
|
||||||
|
|
||||||
|
@Ignore
|
||||||
@Test
|
@Test
|
||||||
public void Create() {
|
public void Create() {
|
||||||
|
|
||||||
|
@ -42,7 +47,22 @@ public class ProbeTaskDAOTest {
|
||||||
|
|
||||||
this.probeTaskDAO.save(probeTask);
|
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 );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user