fixed infra service, test

This commit is contained in:
snoop 2017-07-28 16:29:50 +09:00
parent 798021e757
commit 952706d358
4 changed files with 18 additions and 5 deletions

View File

@ -17,8 +17,8 @@ public class InfraMachineService {
return this.infraMachineDAO.save(infraMachine);
}
public InfraMachine read(String id) {
return this.infraMachineDAO.findOne(Long.valueOf(id));
public InfraMachine read(long id) {
return this.infraMachineDAO.findOne(id);
}
}

View File

@ -19,7 +19,7 @@ public class InfraOSService {
return this.infraOSDAO.save(infraOS);
}
public InfraOS read(String id) {
return this.infraOSDAO.findOne(Long.valueOf(id));
public InfraOS read(long id) {
return this.infraOSDAO.findOne(id);
}
}

View File

@ -4,6 +4,7 @@ import com.loafle.overflow.module.infra.model.InfraMachine;
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;
@ -22,8 +23,8 @@ public class InfraMachineServiceTest {
@Autowired
private InfraMachineService infraMachineService;
@Test
@Ignore
@Test
public void regist() throws Exception {
InfraMachine infraMachine = new InfraMachine();
@ -38,6 +39,12 @@ public class InfraMachineServiceTest {
@Test
public void read() throws Exception {
InfraMachine infraMachine = this.infraMachineService.read(1);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(infraMachine);
System.out.println(json);
}
}

View File

@ -6,6 +6,7 @@ import com.loafle.overflow.module.meta.model.MetaInfraVendor;
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.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -45,6 +46,11 @@ public class InfraOSServiceTest {
@Test
public void read() throws Exception {
InfraOS infraOS = this.infraOSService.read(1);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(infraOS);
System.out.println(json);
}
}