fixed infra

read (string) -> read(long)
This commit is contained in:
snoop 2017-07-28 12:26:13 +09:00
parent feaa908023
commit bc2d33f5f5
4 changed files with 21 additions and 4 deletions

View File

@ -19,7 +19,7 @@ public class InfraHostService {
return this.infraHostDAO.save(infraHost);
}
public InfraHost read(String id) {
return this.infraHostDAO.findOne(Long.valueOf(id));
public InfraHost read(long id) {
return this.infraHostDAO.findOne(id);
}
}

View File

@ -19,8 +19,8 @@ public class InfraService {
return this.infraDAO.save(infra);
}
public Infra read(String id) {
return this.infraDAO.findOne(Long.valueOf(id));
public Infra read(long id) {
return this.infraDAO.findOne(id);
}
}

View File

@ -5,6 +5,7 @@ import com.loafle.overflow.module.infra.model.InfraOS;
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.Test;
import org.junit.runner.RunWith;
@ -45,6 +46,14 @@ public class InfraHostServiceTest {
@Test
public void read() throws Exception {
InfraHost infraHost = this.infraHostService.read(1);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(infraHost);
System.out.println(json);
}
}

View File

@ -8,6 +8,7 @@ import com.loafle.overflow.module.target.model.Target;
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.Test;
import org.junit.runner.RunWith;
@ -69,6 +70,13 @@ public class InfraServiceTest {
@Test
public void read() throws Exception {
Infra infra = this.infraService.read(3);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(infra);
System.out.println(json);
}
}