diff options
author | Jakub Dudycz <jakub.dudycz@nokia.com> | 2018-03-22 16:43:48 +0100 |
---|---|---|
committer | Jakub Dudycz <jakub.dudycz@nokia.com> | 2018-03-22 16:43:48 +0100 |
commit | 957aad2599fe9e694dbe63f900f272c1028687e2 (patch) | |
tree | 948d5e65cf6da76590059519ac406a2c758c1dc5 /generic-resource-api/provider/src/main | |
parent | 894476cd13c0045d8ce44bf77f1729a3f44c0e10 (diff) |
GenericResourceApiProvider unit tests part 7.
Added unit tests for tunnelxconnTopologyOperation and brgTopologyOperation methods
Change-Id: I2172a62bddb3f394caf93c56ed2078efc153f3ea
Issue-ID: SDNC-275
Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
Diffstat (limited to 'generic-resource-api/provider/src/main')
-rw-r--r-- | generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java index 099d723c..6c6e424e 100644 --- a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java +++ b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java @@ -1722,25 +1722,25 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC // Call SLI sync method // Get SvcLogicService reference - ResponseObject error = new ResponseObject("200", ""); + ResponseObject responseObject = new ResponseObject("200", ""); String ackFinal = "Y"; String allottedResourceId = ERROR_NETWORK_ID; String serviceObjectPath = null; String tunnelxconnObjectPath = null; - Properties respProps = tryGetProperties(svcOperation, parms, error); + Properties respProps = tryGetProperties(svcOperation, parms, responseObject); if (respProps != null) { - error.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM)); - error.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM)); + responseObject.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM)); + responseObject.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM)); ackFinal = respProps.getProperty(ACK_FINAL_PARAM, "Y"); allottedResourceId = respProps.getProperty(ALLOTTED_RESOURCE_ID_PARAM); serviceObjectPath = respProps.getProperty(SERVICE_OBJECT_PATH_PARAM); tunnelxconnObjectPath = respProps.getProperty("tunnelxconn-object-path"); } - if (failed(error)) { - responseBuilder.setResponseCode(error.getStatusCode()); - responseBuilder.setResponseMessage(error.getMessage()); + if (failed(responseObject)) { + responseBuilder.setResponseCode(responseObject.getStatusCode()); + responseBuilder.setResponseMessage(responseObject.getMessage()); responseBuilder.setAckFinalIndicator(ackFinal); log.error(RETURNED_FAILED_MESSAGE, svcOperation, siid, responseBuilder.build()); @@ -1781,9 +1781,9 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC } // Update succeeded - responseBuilder.setResponseCode(error.getStatusCode()); + responseBuilder.setResponseCode(responseObject.getStatusCode()); responseBuilder.setAckFinalIndicator(ackFinal); - trySetResponseMessage(responseBuilder, error); + trySetResponseMessage(responseBuilder, responseObject); log.info(UPDATED_MDSAL_INFO_MESSAGE, svcOperation, siid); log.info(RETURNED_SUCCESS_MESSAGE, svcOperation, siid, responseBuilder.build()); @@ -1808,7 +1808,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC || input.getServiceInformation().getServiceInstanceId().length() == 0; } - private Properties tryGetProperties(String svcOperation, Properties parms, ResponseObject error) { + private Properties tryGetProperties(String svcOperation, Properties parms, ResponseObject responseObject) { try { if (svcLogicClient.hasGraph(APP_NAME, svcOperation, null, "sync")) { @@ -1816,16 +1816,16 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC return svcLogicClient.execute(APP_NAME, svcOperation, null, "sync", parms); } catch (Exception e) { log.error(SERVICE_LOGIC_EXECUTION_ERROR_MESSAGE, svcOperation, e); - error.setMessage(e.getMessage()); - error.setStatusCode("500"); + responseObject.setMessage(e.getMessage()); + responseObject.setStatusCode("500"); } } else { - error.setMessage(NO_SERVICE_LOGIC_ACTIVE + APP_NAME + ": '" + svcOperation + "'"); - error.setStatusCode("503"); + responseObject.setMessage(NO_SERVICE_LOGIC_ACTIVE + APP_NAME + ": '" + svcOperation + "'"); + responseObject.setStatusCode("503"); } } catch (Exception e) { - error.setMessage(e.getMessage()); - error.setStatusCode("500"); + responseObject.setMessage(e.getMessage()); + responseObject.setStatusCode("500"); log.error(SERVICE_LOGIC_SEARCH_ERROR_MESSAGE, e); } return null; |