This commit is contained in:
insanity 2018-06-28 17:43:18 +09:00
parent 6e4405750e
commit c29ea212b5
2 changed files with 41 additions and 42 deletions

View File

@ -50,7 +50,7 @@
<dependency>
<groupId>com.loafle.overflow</groupId>
<artifactId>commons-java</artifactId>
<version>1.0.106-SNAPSHOT</version>
<version>1.0.109-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -1,8 +1,12 @@
package com.loafle.overflow.central.module.sensor.service;
import com.loafle.overflow.central.module.meta.dao.MetaDisplayItemMappingDAO;
import com.loafle.overflow.central.spring.AppConfigTest;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.loafle.overflow.model.sensor.Sensor;
import com.loafle.overflow.model.target.Target;
import com.loafle.overflow.service.central.sensor.SensorService;
import com.loafle.overflow.service.central.target.TargetService;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@ -11,11 +15,6 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by insanity on 17. 6. 28.
*/
@ -26,24 +25,24 @@
@Autowired
SensorService sensorService;
@Autowired
TargetService targetService;
@Autowired
MetaDisplayItemMappingDAO metaDisplayItemMappingService;
@Autowired
ObjectMapper objectMapper;
@Test
@Ignore
public void regist() throws Exception {
Sensor sensor = new Sensor();
MetaSensorStatus status = new MetaSensorStatus((short)1);
sensor.setStatus(status);
MetaCrawler crawler = new MetaCrawler();
crawler.setId((short)1);
sensor.setCrawler(crawler);
Target target = new Target();
target.setId(1);
sensor.setTarget(target);
sensor.setCreateDate(new Date());
Sensor res = this.sensorService.regist(sensor);
Assert.assertNotNull(res);
Target target = this.targetService.read(Long.valueOf(1));
Sensor sensor = new Sensor();
sensor.setTarget(target);
Sensor result = this.sensorService.regist(sensor, this.metaDisplayItemMappingService.findAll());
Assert.assertNotNull(result);
}
}