default sensor test succeed

This commit is contained in:
insanity 2018-06-29 16:38:20 +09:00
parent dc5d5aa56d
commit d8c8101dba
3 changed files with 10 additions and 3 deletions

View File

@ -25,11 +25,16 @@ public class CentralSensorItemService implements SensorItemService {
@Autowired
private CentralSensorService sensorService;
@Transactional
public SensorItem regist(Sensor sensor, MetaDisplayItemMapping metaDisplayItemMapping) throws OverflowException {
SensorItem sensorItem = new SensorItem();
sensorItem.setMetaDisplayItemMapping(metaDisplayItemMapping);
sensorItem.setSensor(sensor);
return this.sensorItemDAO.save(sensorItem);
SensorItem retSensorItem = this.sensorItemDAO.save(sensorItem);
if (null != retSensorItem) {
this.sensorService.increaseSensorItemCount(sensor.getId());
}
return retSensorItem;
}
@Override

View File

@ -37,6 +37,7 @@ public class CentralSensorService implements SensorService {
@Autowired
private CentralSensorConfigService sensorConfigService;
@Transactional
public void registDefaults(List<Target> targets) throws OverflowException {
for (Target target : targets) {
this.registDefault(target);

View File

@ -44,9 +44,10 @@ public class SensorServiceTest {
InfraService infraService;
@Test
@Ignore
public void registDefault() throws Exception {
Long tempInfraID = Long.valueOf(1);
Long tempProbeID = Long.valueOf(1);
Long tempInfraID = Long.valueOf(28); // ssh
Long tempProbeID = Long.valueOf(3);
Infra infra = this.infraService.read(tempInfraID);
List<Long> infraIDs = new ArrayList<>();