SensorServiceTest
This commit is contained in:
parent
3fbc080d70
commit
6a3cb4af63
@ -1,8 +1,13 @@
|
|||||||
package com.loafle.overflow.central.module.sensor.service;
|
package com.loafle.overflow.central.module.sensor.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.central.module.meta.dao.MetaCrawlerMappingDAO;
|
||||||
import com.loafle.overflow.central.module.meta.dao.MetaDisplayItemMappingDAO;
|
import com.loafle.overflow.central.module.meta.dao.MetaDisplayItemMappingDAO;
|
||||||
import com.loafle.overflow.central.spring.AppConfigTest;
|
import com.loafle.overflow.central.spring.AppConfigTest;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.loafle.overflow.model.meta.MetaCrawlerMapping;
|
||||||
import com.loafle.overflow.model.sensor.Sensor;
|
import com.loafle.overflow.model.sensor.Sensor;
|
||||||
import com.loafle.overflow.model.target.Target;
|
import com.loafle.overflow.model.target.Target;
|
||||||
import com.loafle.overflow.service.central.sensor.SensorService;
|
import com.loafle.overflow.service.central.sensor.SensorService;
|
||||||
@ -30,9 +35,8 @@ public class SensorServiceTest {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
MetaDisplayItemMappingDAO metaDisplayItemMappingService;
|
MetaDisplayItemMappingDAO metaDisplayItemMappingService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ObjectMapper objectMapper;
|
MetaCrawlerMappingDAO metaCrawlerMappingDAO;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
@Ignore
|
||||||
@ -42,7 +46,40 @@ public class SensorServiceTest {
|
|||||||
Sensor sensor = new Sensor();
|
Sensor sensor = new Sensor();
|
||||||
sensor.setTarget(target);
|
sensor.setTarget(target);
|
||||||
|
|
||||||
|
List<MetaCrawlerMapping> metaCrawlerMappings = this.metaCrawlerMappingDAO.findAll();
|
||||||
|
sensor.setMetaCrawlerMapping(metaCrawlerMappings.get(0));
|
||||||
|
|
||||||
Sensor result = this.sensorService.regist(sensor, this.metaDisplayItemMappingService.findAll());
|
Sensor result = this.sensorService.regist(sensor, this.metaDisplayItemMappingService.findAll());
|
||||||
Assert.assertNotNull(result);
|
Assert.assertNotNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore
|
||||||
|
public void readAllByTargetID() throws Exception {
|
||||||
|
this.regist();
|
||||||
|
Assert.assertNotNull(this.sensorService.readAllByTargetID(Long.valueOf(1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore
|
||||||
|
public void readAllByTargetIn() throws Exception {
|
||||||
|
this.regist();
|
||||||
|
List<Target> targets = new ArrayList<Target>();
|
||||||
|
Target t1 = new Target();
|
||||||
|
t1.setId(Long.valueOf(1));
|
||||||
|
Target t2 = new Target();
|
||||||
|
t2.setId(Long.valueOf(2));
|
||||||
|
targets.add(t1);
|
||||||
|
targets.add(t2);
|
||||||
|
List<Sensor> sensors = this.sensorService.readAllByTargetIn(targets);
|
||||||
|
Assert.assertNotNull(sensors);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore
|
||||||
|
public void readAllByTargetInfraProbeID() throws Exception {
|
||||||
|
this.regist();
|
||||||
|
List<Sensor> sensors = this.sensorService.readAllByTargetInfraProbeID(Long.valueOf(1));
|
||||||
|
Assert.assertNotNull(sensors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user