fixed infra service, test
This commit is contained in:
parent
798021e757
commit
952706d358
|
@ -17,8 +17,8 @@ public class InfraMachineService {
|
||||||
return this.infraMachineDAO.save(infraMachine);
|
return this.infraMachineDAO.save(infraMachine);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InfraMachine read(String id) {
|
public InfraMachine read(long id) {
|
||||||
return this.infraMachineDAO.findOne(Long.valueOf(id));
|
return this.infraMachineDAO.findOne(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class InfraOSService {
|
||||||
return this.infraOSDAO.save(infraOS);
|
return this.infraOSDAO.save(infraOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InfraOS read(String id) {
|
public InfraOS read(long id) {
|
||||||
return this.infraOSDAO.findOne(Long.valueOf(id));
|
return this.infraOSDAO.findOne(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.loafle.overflow.module.infra.model.InfraMachine;
|
||||||
import com.loafle.overflow.spring.AppConfig;
|
import com.loafle.overflow.spring.AppConfig;
|
||||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||||
import com.loafle.overflow.spring.MailConfiguration;
|
import com.loafle.overflow.spring.MailConfiguration;
|
||||||
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -22,8 +23,8 @@ public class InfraMachineServiceTest {
|
||||||
@Autowired
|
@Autowired
|
||||||
private InfraMachineService infraMachineService;
|
private InfraMachineService infraMachineService;
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
@Ignore
|
||||||
|
@Test
|
||||||
public void regist() throws Exception {
|
public void regist() throws Exception {
|
||||||
|
|
||||||
InfraMachine infraMachine = new InfraMachine();
|
InfraMachine infraMachine = new InfraMachine();
|
||||||
|
@ -38,6 +39,12 @@ public class InfraMachineServiceTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void read() throws Exception {
|
public void read() throws Exception {
|
||||||
|
|
||||||
|
InfraMachine infraMachine = this.infraMachineService.read(1);
|
||||||
|
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
String json = objectMapper.writeValueAsString(infraMachine);
|
||||||
|
System.out.println(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@ import com.loafle.overflow.module.meta.model.MetaInfraVendor;
|
||||||
import com.loafle.overflow.spring.AppConfig;
|
import com.loafle.overflow.spring.AppConfig;
|
||||||
import com.loafle.overflow.spring.JdbcConfiguration;
|
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||||
import com.loafle.overflow.spring.MailConfiguration;
|
import com.loafle.overflow.spring.MailConfiguration;
|
||||||
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
@ -45,6 +46,11 @@ public class InfraOSServiceTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void read() throws Exception {
|
public void read() throws Exception {
|
||||||
|
|
||||||
|
InfraOS infraOS = this.infraOSService.read(1);
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
String json = objectMapper.writeValueAsString(infraOS);
|
||||||
|
System.out.println(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user