added ignore

This commit is contained in:
snoop 2017-07-27 12:33:39 +09:00
parent 3c33a76228
commit 4c499923d3
2 changed files with 22 additions and 1 deletions

View File

@ -5,6 +5,8 @@ import com.loafle.overflow.module.sensor.model.Sensor;
import com.loafle.overflow.module.sensor.model.SensorItem;
import com.loafle.overflow.spring.AppConfig;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@ -13,14 +15,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
* Created by insanity on 17. 6. 28.
*/
@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class})
public class SensorItemServiceTest {
@Autowired
SensorItemService sensorItemService;
@ -45,4 +49,15 @@ public class SensorItemServiceTest {
SensorItem res = this.sensorItemService.read("1");
Assert.assertNotNull(res);
}
@Test
public void readAllBySensor() throws IOException {
Sensor sensor = new Sensor();
sensor.setId(1);
List<SensorItem> sensorItems = this.sensorItemService.readAllBySensor(sensor);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(sensorItems);
System.out.println(json);
}
}

View File

@ -50,6 +50,12 @@ public class SensorServiceTest {
public void read() throws Exception {
Sensor res = this.sensorService.read("1");
Assert.assertNotNull(res);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(res);
System.out.println(json);
}
@Test