diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2016-10-21 15:41:31 +0800 |
---|---|---|
committer | Luji <lu.ji3@zte.com.cn> | 2016-10-24 02:13:50 +0000 |
commit | 00c37dd4204436a0d2e5ad7ca6352d1b2750c94d (patch) | |
tree | bfdf74fcc1dd6e18651d86602be818b59c3bf1e3 /servicegateway/service | |
parent | f25210ac4abd2a71479cffc8189609a18131fb2c (diff) |
GSO-34 Fix unmarshal json error.
Change-Id: Ife9941fbb9f765673edd22613d41603a7d11060a
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
(cherry picked from commit aa290444e456ebfc7b8cf48ea344e17c17105a0a)
Diffstat (limited to 'servicegateway/service')
4 files changed, 4 insertions, 5 deletions
diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java index 7b3cec0c..059e6fdc 100644 --- a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java @@ -108,7 +108,7 @@ public class ServiceGatewayRoaModuleImpl implements IServiceGatewayRoaModule { ValidateUtil.assertStringNotNull(reqContent); // 2. Delete service - result = serviceGateway.deleteService(serviceId, servletReq); + result = serviceGateway.deleteService(serviceId, reqContent, servletReq); } catch(ServiceException exception) { LOGGER.error("Fail to delete service instance."); return Response.serverError().build(); diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java index bc716d5e..4f592f5b 100644 --- a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java @@ -131,14 +131,13 @@ public class ServiceGatewayImpl implements IServiceGateway { * @since GSO 0.5 */ @Override - public Map<String, Object> deleteService(String serviceId, HttpServletRequest httpRequest) throws ServiceException { + public Map<String, Object> deleteService(String serviceId, String reqContent, HttpServletRequest httpRequest) throws ServiceException { if(httpRequest == null) { LOGGER.error("ServiceGatewayImpl.deleteService httpRequest is null"); throw new ServiceException("ServiceGatewayImpl.deleteService httpRequest is null"); } // Parse request - String reqContent = RestUtils.getRequestBody(httpRequest); Map<String, Object> requestBody = JsonUtil.unMarshal(reqContent, Map.class); ValidateUtil.assertObjectNotNull(requestBody); diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java index cba925c6..a5f6b6fa 100644 --- a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java @@ -52,6 +52,6 @@ public interface IServiceGateway { * @throws ServiceException operate DB or parameter is wrong. * @since GSO 0.5 */ - Map<String, Object> deleteService(String serviceId, HttpServletRequest httpRequest) throws ServiceException; + Map<String, Object> deleteService(String serviceId, String reqContent, HttpServletRequest httpRequest) throws ServiceException; } diff --git a/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java index d1cb3916..b7c1657f 100644 --- a/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java +++ b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java @@ -66,7 +66,7 @@ public class ServiceGatewayImplTest { */ @Test(expected = ServiceException.class) public void testDeleteServiceFail() throws ServiceException { - serviceManager.deleteService(null, httpRequest); + serviceManager.deleteService(null, "", httpRequest); } } |