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();
* @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);
* @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;
}
*/
@Test(expected = ServiceException.class)
public void testDeleteServiceFail() throws ServiceException {
- serviceManager.deleteService(null, httpRequest);
+ serviceManager.deleteService(null, "", httpRequest);
}
}