This commit is contained in:
crusader 2018-06-21 22:02:51 +09:00
parent c9d5d19706
commit 61c55c035b

View File

@ -21,10 +21,9 @@ import java.util.List;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test") @ActiveProfiles("test")
@ContextConfiguration(classes = {AppConfigTest.class}) @ContextConfiguration(classes = { AppConfigTest.class })
public class CentralTargetServiceTest { public class CentralTargetServiceTest {
@Autowired @Autowired
@ -43,20 +42,20 @@ public class CentralTargetServiceTest {
public void regist() { public void regist() {
} }
// List<Target> targets, Long probeID // List<Target> targets, Long probeID
@Test @Test
public void registAll() throws OverflowException { public void registAll() throws OverflowException {
List<Target> targets = new ArrayList<>(); List<Target> targets = new ArrayList<>();
List<Sensor> sensors = new ArrayList<>(); List<Sensor> sensors = new ArrayList<>();
List<MetaCrawler> metaCrawlers = this.metaCrawlerService.readAll(); List<MetaCrawler> metaCrawlers = this.metaCrawlerService.readAll();
List<MetaSensorStatus> metaSensorStatusList = this.metaSensorStatusService.readAll(); List<MetaSensorStatus> metaSensorStatusList = this.metaSensorStatusService.readAll();
// MetaSensorDisplayItem metaSensorDisplayItem = this.metaSensorDisplayItemService.read(Long.valueOf(1)); // MetaSensorDisplayItem metaSensorDisplayItem =
// this.metaSensorDisplayItemService.read(Long.valueOf(1));
Target target = new Target(); Target target = new Target();
target.setMetaTargetType(MetaTargetServiceType.Enum.UNKNOWN.to()); target.setMetaTargetType(MetaTargetServiceType.Enum.UNKNOWN.to());
target.setInfra(new com.loafle.overflow.model.infra.InfraService(Long.valueOf((long)3))); target.setInfra(new com.loafle.overflow.model.infra.InfraService(Long.valueOf((long) 3)));
Sensor sensor = new Sensor(); Sensor sensor = new Sensor();
sensor.setItemCount(0); sensor.setItemCount(0);
@ -71,8 +70,9 @@ public class CentralTargetServiceTest {
target.setSensors(sensors); target.setSensors(sensors);
targets.add(target); targets.add(target);
List<Target> targetList = this.targetService.registAll(targets, Long.valueOf(1)); // List<Target> targetList = this.targetService.registAll(targets,
// Long.valueOf(1));
System.out.println("Target List Size: " + targetList.size()); // System.out.println("Target List Size: " + targetList.size());
} }
} }