diff options
author | Rob Daugherty <rd472p@att.com> | 2018-05-15 13:23:01 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-05-15 13:58:10 -0400 |
commit | d2e69c0d689596033a9c35aa98d37a44e2cc88cb (patch) | |
tree | be29159a319f63c9e5c242da6354c1ef0133363a | |
parent | b4d4cb8703842aee6df6c9a5d2a0fd6617539233 (diff) |
WorkflowResponse json issues
This commit adds some robustness to the interface between the
API-H and BPMN, specifically, in how the response is handled.
I don't have proof, but there appears to be some randomness to
the json provider behavior when used with the jax-rs. Sometimes,
the serializer is adding the root element, and sometimes it
is not. Maybe there's something wrong with the configuration.
Maybe we have competing json providers. I couldn't pin this
down.
I'm almost certain it is the presence of the root element in
the content that causes the API-H code to fail parsing of the
BPMN response. This doesn't kill the request, as you might
expect, but rather, the API-H passes the BPMN response through
to the client (VID, or policy, or whatever).
The original problem (SO-586) was "fixed" by "removing the
wrapper". This "wrapper" is a needed feature of the interface
between BPMN and the API-H. We shouldn't have removed it.
The fact that the "fix" appeared to work is due to the
behavior I described in the previous paragraph. The API-H
chokes on the message, and it passes it through unchanged.
Not really what we want.
So, I don't know why the jackson/json behavior is flaky and
different now, but I can (and did) modify the API-H so it can
parse a json message whether or not it has a root element.
Note that WorkflowResponse.java (in BPMN) and CamundaResponse.java
(in the API-H) are basically the same bean representing the
message format. Seems less than ideal to have two different
classes.
Also note that I changed the name of the "response" attribute
of the WorkflowResponse and CamundaResponse classes to "content".
Got tired of seeing this nonsense everywhere in the code:
response.getResponse()
Change-Id: Icaf70f8457de99e493cf882170fe778c620308c9
Issue-ID: SO-586
Issue-ID: SO-618
Signed-off-by: Rob Daugherty <rd472p@att.com>
46 files changed, 551 insertions, 305 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java index db11db59f7..b4543b1445 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java @@ -109,13 +109,13 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService { msoLogger.debug(logMarker + "Exception in startProcessInstance by key");
WorkflowResponse response = new WorkflowResponse();
response.setMessage("Fail" );
- response.setResponse("Error occurred while executing the process: " + e);
+ response.setContent("Error occurred while executing the process: " + e);
response.setMessageCode(500);
recordEvents(processKey, response, startTime);
msoLogger.error (MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, logMarker
+ response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse());
+ + processKey + " with content: " + response.getContent());
Response errorResponse = Response.serverError().entity(response).build();
asyncResponse.setResponse(errorResponse);
@@ -245,10 +245,10 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService { msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
logMarker + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);
+ + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);
msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- logMarker + response.getMessage() + "for processKey: " + processKey + " with response: " + response.getResponse());
+ logMarker + response.getMessage() + "for processKey: " + processKey + " with content: " + response.getContent());
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContextHolder.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContextHolder.java index aab4faf23b..4dfae8b2a3 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContextHolder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContextHolder.java @@ -108,19 +108,19 @@ public class WorkflowContextHolder { + ":process key:" + processKey); workflowResponse.setMessage("Fail"); workflowResponse.setMessageCode(400); - workflowResponse.setResponse("Unable to correlate workflow context, bad request. Request Id: " + requestId); + workflowResponse.setContent("Unable to correlate workflow context, bad request. Request Id: " + requestId); return Response.serverError().entity(workflowResponse).build(); } responseQueue.remove(workflowContext); msoLogger.debug("Using callback response for request id: " + requestId); - workflowResponse.setResponse(callbackResponse.getResponse()); - workflowResponse.setProcessInstanceID(processInstanceId); + workflowResponse.setContent(callbackResponse.getResponse()); + workflowResponse.setProcessInstanceId(processInstanceId); workflowResponse.setMessageCode(callbackResponse.getStatusCode()); workflowResponse.setMessage(callbackResponse.getMessage()); sendWorkflowResponseToClient(processKey, workflowContext, workflowResponse); - return Response.ok().entity(workflowResponse.getResponse()).build(); + return Response.ok().entity(workflowResponse).build(); } /** @@ -133,7 +133,7 @@ public class WorkflowContextHolder { WorkflowResponse workflowResponse) { msoLogger.debug(logMarker + "Sending the response for request id: " + workflowContext.getRequestId()); recordEvents(processKey, workflowResponse, workflowContext.getStartTime()); - Response response = Response.status(workflowResponse.getMessageCode()).entity(workflowResponse.getResponse()).build(); + Response response = Response.status(workflowResponse.getMessageCode()).entity(workflowResponse).build(); AsynchronousResponse asyncResp = workflowContext.getAsynchronousResponse(); asyncResp.setResponse(response); } @@ -152,7 +152,7 @@ public class WorkflowContextHolder { msoLogger.debug("Preparing timeout response for " + requestObject.getProcessKey() + ":" + ":" + requestObject.getRequestId()); WorkflowResponse response = new WorkflowResponse(); response.setMessage("Fail"); - response.setResponse("Request timedout, request id:" + requestObject.getRequestId()); + response.setContent("Request timedout, request id:" + requestObject.getRequestId()); //response.setProcessInstanceID(requestObject.getProcessInstance().getProcessInstanceId()); recordEvents(requestObject.getProcessKey(), response, requestObject.getStartTime()); response.setMessageCode(500); @@ -178,11 +178,11 @@ public class WorkflowContextHolder { msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, logMarker + response.getMessage() + " for processKey: " - + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null); + + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null); msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, logMarker + response.getMessage() + " for processKey: " - + processKey + " with response: " + response.getResponse()); + + processKey + " with content: " + response.getContent()); } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java index dd100a3824..25c67fed63 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java @@ -135,7 +135,7 @@ public class WorkflowResource extends ProcessEngineAwareService { }
String processInstanceId = processInstance.getId();
- workflowResponse.setProcessInstanceID(processInstanceId);
+ workflowResponse.setProcessInstanceId(processInstanceId);
responseMap = getResponseMap(processInstance, processKey, timeProcessEnded);
@@ -172,23 +172,23 @@ public class WorkflowResource extends ProcessEngineAwareService { workflowResponse.setMessage("Fail");
if (endedWithNoResponse) {
- workflowResponse.setResponse("Process ended without producing a response");
+ workflowResponse.setContent("Process ended without producing a response");
} else {
- workflowResponse.setResponse("Request timed out, process state: " + state);
+ workflowResponse.setContent("Request timed out, process state: " + state);
}
- workflowResponse.setProcessInstanceID(processInstanceId);
+ workflowResponse.setProcessInstanceId(processInstanceId);
recordEvents(processKey, workflowResponse, startTime);
workflowResponse.setMessageCode(500);
return Response.status(500).entity(workflowResponse).build();
} catch (Exception ex) {
msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key",ex);
workflowResponse.setMessage("Fail" );
- workflowResponse.setResponse("Error occurred while executing the process: " + ex.getMessage());
- if (processInstance != null) workflowResponse.setProcessInstanceID(processInstance.getId());
+ workflowResponse.setContent("Error occurred while executing the process: " + ex.getMessage());
+ if (processInstance != null) workflowResponse.setProcessInstanceId(processInstance.getId());
msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MDC.get(processKey),
MsoLogger.ErrorCode.UnknownError, LOGMARKER + workflowResponse.getMessage()
- + " for processKey: " + processKey + " with response: " + workflowResponse.getResponse());
+ + " for processKey: " + processKey + " with content: " + workflowResponse.getContent());
workflowResponse.setMessageCode(500);
recordEvents(processKey, workflowResponse, startTime);
@@ -221,11 +221,11 @@ public class WorkflowResource extends ProcessEngineAwareService { msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);
+ + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);
msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse());
+ + processKey + " with content: " + response.getContent());
}
private void setLogContext(String processKey, Map<String, Object> inputVariables) {
@@ -262,13 +262,13 @@ public class WorkflowResource extends ProcessEngineAwareService { private void processResponseMap(WorkflowResponse workflowResponse, Map<String, Object> responseMap) {
Object object = responseMap.get("Response");
- String response = object == null ? null : String.valueOf(object);
- if(response == null){
+ String content = object == null ? null : String.valueOf(object);
+ if (content == null){
object = responseMap.get("WorkflowResponse");
- response = object == null ? null : String.valueOf(object);
+ content = object == null ? null : String.valueOf(object);
}
- workflowResponse.setResponse(response);
+ workflowResponse.setContent(content);
object = responseMap.get("ResponseCode");
String responseCode = object == null ? null : String.valueOf(object);
@@ -584,31 +584,31 @@ public class WorkflowResource extends ProcessEngineAwareService { response.setVariables(variablesMap);
response.setMessage("Success");
- response.setResponse("Successfully retrieved the variables");
- response.setProcessInstanceID(processInstanceId);
+ response.setContent("Successfully retrieved the variables");
+ response.setProcessInstanceId(processInstanceId);
- msoLogger.debug(LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with response: " + response.getResponse());
+ msoLogger.debug(LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with content: " + response.getContent());
} catch (Exception ex) {
response.setMessage("Fail");
- response.setResponse("Failed to retrieve the variables," + ex.getMessage());
- response.setProcessInstanceID(processInstanceId);
+ response.setContent("Failed to retrieve the variables," + ex.getMessage());
+ response.setProcessInstanceId(processInstanceId);
msoLogger.error (MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MDC.get(processKey), MsoLogger.ErrorCode.UnknownError, LOGMARKER
+ response.getMessage()
+ " for processKey: "
+ processKey
- + " with response: "
- + response.getResponse());
+ + " with content: "
+ + response.getContent());
msoLogger.debug("Exception :",ex);
}
msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);
+ + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);
msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse());
+ + processKey + " with content: " + response.getContent());
return response;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResponse.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResponse.java index e0382d1bda..02702e3b3c 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResponse.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResponse.java @@ -22,48 +22,76 @@ package org.openecomp.mso.bpmn.common.workflow.service; import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
/**
- * @version 1.0
- * Synchronous workflow response bean
- *
+ * A synchronous response from a workflow.
*/
public class WorkflowResponse {
- private String response;
- private String message;
- private String processInstanceID;
- private Map<String,String> variables;
+ @JsonProperty("processInstanceId")
+ private String processInstanceId;
+
+ @JsonProperty("messageCode")
private int messageCode;
+
+ @JsonProperty("message")
+ private String message;
- public String getResponse() {
- return response;
+ @JsonProperty("variables")
+ private Map<String,String> variables;
+
+ @JsonProperty("content")
+ private String content;
+
+ public String getProcessInstanceId() {
+ return processInstanceId;
}
- public void setResponse(String response) {
- this.response = response;
+
+ public void setProcessInstanceId(String processInstanceId) {
+ this.processInstanceId = processInstanceId;
+ }
+
+ public int getMessageCode() {
+ return messageCode;
}
+
+ public void setMessageCode(int messageCode) {
+ this.messageCode = messageCode;
+ }
+
public String getMessage() {
return message;
}
+
public void setMessage(String message) {
this.message = message;
}
- public String getProcessInstanceID() {
- return processInstanceID;
- }
- public void setProcessInstanceID(String pID) {
- this.processInstanceID = pID;
- }
- public Map<String, String> getVariables() {
+
+ public Map<String,String> getVariables() {
return variables;
}
- public void setVariables(Map<String, String> variables) {
+
+ public void setVariables(Map<String,String> variables) {
this.variables = variables;
}
- public void setMessageCode(int messageCode) {
- this.messageCode = messageCode;
+
+ public String getContent() {
+ return content;
}
-
- public int getMessageCode() {
- return messageCode;
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + "["
+ + "processInstanceId=" + processInstanceId
+ + ",messageCode=" + messageCode
+ + ",message=" + message
+ + ",variables=" + variables
+ + ",content=" + content
+ + "]";
}
-}
+}
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java index 1400e6ea77..0bb5186a17 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java @@ -238,14 +238,7 @@ public class BPMNUtil { doAnswer(new Answer<Void>() {
public Void answer(InvocationOnMock invocation) {
Response response = (Response) invocation.getArguments()[0];
- try {
- workflowResponse = (WorkflowResponse) response.getEntity();
- } catch (ClassCastException e) {
- String workflowResponseString = (String)response.getEntity();
- workflowResponse = new WorkflowResponse();
- workflowResponse.setResponse(workflowResponseString);
- workflowResponse.setMessageCode(200);
- }
+ workflowResponse = (WorkflowResponse) response.getEntity();
return null;
}
}).when(asyncResponse).setResponse(any(Response.class));
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java index 9d4dac2333..bf69223b52 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java @@ -46,7 +46,7 @@ public class CompleteMsoProcessTest extends WorkflowTest { variables.put("CompleteMsoProcessRequest",inputRequestFile);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CompleteMsoProcess", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
logEnd();
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java index 457128f104..13c400e71e 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java @@ -50,7 +50,7 @@ public class ConfirmVolumeGroupTenantTest extends WorkflowTest { setVariables(variables); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "ConfirmVolumeGroupTenant", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String actualNameMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "groupNamesMatch"); String actualIdMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "tenantIdsMatch"); @@ -70,7 +70,7 @@ public class ConfirmVolumeGroupTenantTest extends WorkflowTest { setVariables(variables); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "ConfirmVolumeGroupTenant", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String actualNameMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "groupNamesMatch"); String actualIdMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "tenantIdsMatch"); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java index 257cec9b11..c3259a0de5 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java @@ -62,7 +62,7 @@ public class FalloutHandlerTest extends WorkflowTest { variables.put("FalloutHandlerRequest",inputRequestFile);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "FalloutHandler", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
System.out.println("ENDED TEST: " + method);
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java index 125a9ad916..67ac34c1d0 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java @@ -54,7 +54,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { Map<String, String> variables = new HashMap<>(); setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); String resourceVersionProvidedFlag = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_resourceVersionProvidedFlag"); @@ -74,7 +74,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesSubscription(variables, "", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -98,7 +98,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -122,7 +122,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesSubscription(variables, null, "1604-MVM-26", "SDN-ETHERNET-INTERNET", null); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -146,7 +146,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -168,7 +168,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesSubscription(variables, "", "1604-MVM-26", "SDN-ETHERNET-INTERNET", ""); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -193,7 +193,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -214,7 +214,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "1234"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); @@ -240,7 +240,7 @@ public class GenericDeleteServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator"); String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator"); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java index add9a32d61..a318be5b10 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java @@ -55,7 +55,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "true", "true", null); @@ -70,7 +70,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "vce", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "true", "true", null); @@ -87,7 +87,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "generic-vnf", ""); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "true", "false", null); @@ -103,7 +103,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "vce", null); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "true", "false", null); @@ -118,7 +118,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "false", "true", null); @@ -133,7 +133,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "vce", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "false", "true", null); @@ -148,7 +148,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "generic-vnf", ""); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("true", "false", "false", null); @@ -162,7 +162,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("false", "false", "true", "WorkflowException[processKey=GenericDeleteVnf,errorCode=500,errorMessage=Incoming Required Variable is Missing or Null!]"); @@ -177,7 +177,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("false", "false", "true", "WorkflowException[processKey=GenericDeleteVnf,errorCode=500,errorMessage=Received a bad response from AAI]"); @@ -192,7 +192,7 @@ public class GenericDeleteVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables("false", "false", "true", "WorkflowException[processKey=GenericDeleteVnf,errorCode=412,errorMessage=Delete Vnf Received a resource-version Mismatch Error Response from AAI]"); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java index 0198395750..6da6924d11 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java @@ -59,7 +59,7 @@ public class GenericGetServiceTest extends WorkflowTest { Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
@@ -85,7 +85,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesSubscription(variables, "", null , "1604-MVM-26", "SDN-ETHERNET-INTERNET");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -113,7 +113,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, null, "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -143,7 +143,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -172,7 +172,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -196,7 +196,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", "1604-MVM-26");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -223,7 +223,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "", "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -250,7 +250,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -277,7 +277,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -301,7 +301,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "", "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -328,7 +328,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -354,7 +354,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, null, null, "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -379,7 +379,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -407,7 +407,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -434,7 +434,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -463,7 +463,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, null, "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -493,7 +493,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, null, "1604-MVM-26", "XyCorporation", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
@@ -521,7 +521,7 @@ public class GenericGetServiceTest extends WorkflowTest { setVariablesInstance(variables, null, "1604-MVM-26", "CorporationNotPresent", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java index 4922263744..7de493a621 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java @@ -56,7 +56,7 @@ public class GenericGetVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator"); String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator"); @@ -83,7 +83,7 @@ public class GenericGetVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "testVnfName123", "vce"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator"); String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator"); @@ -110,7 +110,7 @@ public class GenericGetVnfTest extends WorkflowTest { setVariables(variables, "", "testVnfName123", "generic-vnf"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator"); String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator"); @@ -137,7 +137,7 @@ public class GenericGetVnfTest extends WorkflowTest { setVariables(variables, null, "testVnfName123", "vce"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator"); String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator"); @@ -166,7 +166,7 @@ public class GenericGetVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator"); String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator"); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java index 0e0a237090..7c003c986a 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java @@ -55,7 +55,7 @@ public class GenericPutVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator"); String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException"); @@ -75,7 +75,7 @@ public class GenericPutVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", vcePayload, "vce"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator"); String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException"); @@ -95,7 +95,7 @@ public class GenericPutVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", genericVnfPayload, ""); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator"); String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException"); @@ -117,7 +117,7 @@ public class GenericPutVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", genericVnfPayload, ""); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator"); String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException"); @@ -137,7 +137,7 @@ public class GenericPutVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator"); String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException"); @@ -158,7 +158,7 @@ public class GenericPutVnfTest extends WorkflowTest { setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator"); String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException"); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java index 0349b178cb..02e029de46 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java @@ -95,7 +95,7 @@ public class SDNCAdapterV1Test extends WorkflowTest { Response response = workflowResource.startProcessInstanceByKey("sdncAdapter", varMap);
WorkflowResponse workflowResponse = (WorkflowResponse) response.getEntity();
- //String pid = workflowResponse.getProcessInstanceID();
+ //String pid = workflowResponse.getProcessInstanceId();
//System.out.println("Back from executing process instance with pid=" + pid);
return workflowResponse;
}
@@ -364,7 +364,7 @@ public class SDNCAdapterV1Test extends WorkflowTest { WorkflowResponse response = thread.workflowResponse;
Assert.assertNotNull(response);
Assert.assertEquals("404 error", response.getMessageCode(),7000);
-// assertProcessInstanceFinished(response.getProcessInstanceID());
+// assertProcessInstanceFinished(response.getProcessInstanceId());
//System.out.println("SDNCAdapter bad synchronous response flow Completed!");
}
@@ -442,7 +442,7 @@ public class SDNCAdapterV1Test extends WorkflowTest { public void run() {
workflowResponse = invokeFlow(workflowRequest);
- workflowResponse.getProcessInstanceID();
+ workflowResponse.getProcessInstanceId();
}
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java index 5f91298958..5562cb80ae 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java @@ -48,7 +48,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest { variables.put("mso-service-request-timeout", "5"); WorkflowResponse workflowResponse = BPMNUtil.executeAsyncWorkflow(processEngineRule, "testAsyncProcess", variables); - assertEquals("Received the request, the process is getting executed, request message<aetgt:CreateTenantRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:service-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type> <msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id> <msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> </aetgt:CreateTenantRequest>", workflowResponse.getResponse()); + assertEquals("Received the request, the process is getting executed, request message<aetgt:CreateTenantRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:service-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type> <msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id> <msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> </aetgt:CreateTenantRequest>", workflowResponse.getContent()); assertEquals(200, workflowResponse.getMessageCode()); } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowContextHolderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowContextHolderTest.java index 47005c80e1..6e2699a40e 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowContextHolderTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowContextHolderTest.java @@ -69,7 +69,6 @@ public class WorkflowContextHolderTest { Assert.assertNull(context2); } - @Ignore // broken by SO-586 @Test public void testProcessCallback() { WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance(); @@ -88,7 +87,7 @@ public class WorkflowContextHolderTest { Assert.assertNotNull(response1.getMessage()); Assert.assertEquals(200,response1.getMessageCode()); Assert.assertEquals("Success", response1.getMessage()); - Assert.assertEquals("Successfully processed request", response1.getResponse()); + Assert.assertEquals("Successfully processed request", response1.getContent()); verify(asyncResponse).setResponse(any(Response.class)); WorkflowContext context1 = contextHolder.getWorkflowContext(workflowContext.getRequestId()); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java index 8208b43fa5..9b8a249511 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java @@ -473,12 +473,6 @@ public class WorkflowTest { (entity == null ? "null" : entity.getClass().getName()) +
", expected WorkflowResponse";
System.out.println(msg);
-
- if (entity instanceof String) {
- WorkflowResponse toRet = new WorkflowResponse();
- toRet.setResponse((String)entity);
- return toRet;
- }
fail(msg);
return null; // unreachable
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java index 07fa4eb53a..a1a9e35865 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java @@ -99,7 +99,7 @@ public class CreateGenericALaCarteServiceInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariables(); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateGenericALaCarteServiceInstance", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "WorkflowResponse"); //assertNotNull(workflowResp); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java index d31f6e7b96..f993d066e4 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java @@ -105,7 +105,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { System.out.println("----------------------------------------------------------"); System.out.println("- got workflow response -"); System.out.println("----------------------------------------------------------"); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); @@ -156,7 +156,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariables2(); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); @@ -219,7 +219,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariablesVID1(); executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); @@ -269,7 +269,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariables1(); executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); @@ -308,7 +308,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariables2(); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); @@ -345,7 +345,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariables2(); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); @@ -395,7 +395,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest { System.out.println("----------------------------------------------------------"); System.out.println("- got workflow response -"); System.out.println("----------------------------------------------------------"); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest")); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java index 27f421dcc7..1e865dfd14 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java @@ -107,7 +107,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectSDNCCallbacks(callbacks, "assign, query");
@@ -169,7 +169,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectSDNCCallbacks(callbacks, "assign, query");
@@ -261,7 +261,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectSDNCCallbacks(callbacks, "assign, query");
@@ -348,7 +348,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectSDNCCallbacks(callbacks, "assign, query");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java index 23999c99ad..2e5a7a418a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java @@ -98,7 +98,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); @@ -148,7 +148,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); @@ -192,7 +192,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); //injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); @@ -239,7 +239,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); injectVNFRestCallbacks(callbacks, "volumeGroupException"); @@ -280,7 +280,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); //injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); @@ -320,7 +320,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); waitForProcessEnd(businessKey, 100000); checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); @@ -358,7 +358,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); waitForProcessEnd(businessKey, 100000); checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java index 075ddab80c..db43de7f14 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java @@ -96,7 +96,7 @@ public class CreateVnfInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); //injectSDNCCallbacks(callbacks, "assign, query"); @@ -114,7 +114,7 @@ public class CreateVnfInfraTest extends WorkflowTest { // injectSDNCCallbacks(callbacks, "assign"); // injectSDNCCallbacks(callbacks, "activate"); //waitForProcessEnd(businessKey, 10000); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); //assertVariables("true", "true", "false", "true", "Success", null); @@ -130,7 +130,7 @@ public class CreateVnfInfraTest extends WorkflowTest { setVariables(variables, null, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables(null, null, null, null, null, "WorkflowException[processKey=CreateVnfInfra,errorCode=2500,errorMessage=Internal Error - WorkflowException Object and/or RequestInfo is null! CreateVnfInfra]"); @@ -148,7 +148,7 @@ public class CreateVnfInfraTest extends WorkflowTest { setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables(null, null, null, null, null, "WorkflowException[processKey=DoCreateVnf,errorCode=404,errorMessage=Service Instance Not Found]"); @@ -180,7 +180,7 @@ public class CreateVnfInfraTest extends WorkflowTest { setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertVariables(null, null, null, null, null, "WorkflowException[processKey=DoCreateVnf,errorCode=5000,errorMessage=Generic Vnf Already Exist.]"); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java index aa05953493..1a52041bd7 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java @@ -78,7 +78,7 @@ public class DeleteGenericALaCarteServiceInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariables();
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteGenericALaCarteServiceInstance", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "WorkflowResponse");
//assertNotNull(workflowResp);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java index 06eb79cfd1..9c32abe373 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java @@ -254,7 +254,7 @@ public class DeleteNetworkInstanceTest extends WorkflowTest { executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
//WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
- //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
Assert.assertNotNull(workflowResp);
@@ -338,4 +338,4 @@ public class DeleteNetworkInstanceTest extends WorkflowTest { }
-}
\ No newline at end of file +}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java index cdc547c47e..ba375f5d78 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java @@ -546,7 +546,7 @@ public class DeleteVfModuleInfraTest extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("DeleteVfModuleInfra",
"v1", businessKey, deleteVfModuleRequest, variables);
WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
// "changedelete" operation not required for deleting a Vf Module
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java index 84050c40e5..0e2cf1b6b3 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java @@ -74,7 +74,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest { "v1", businessKey, deleteVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); @@ -113,7 +113,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest { "v1", businessKey, deleteVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); //injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); @@ -153,7 +153,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest { "v1", businessKey, deleteVfModuleVolRequest, testVariables); WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); //injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java index 89bf141247..3ab3f713f4 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java @@ -82,7 +82,7 @@ public class DeleteVnfInfraTest extends WorkflowTest { Map<String, String> variables = new HashMap<>(); setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); Object cascadeDelete = BPMNUtil.getRawVariable(processEngineRule, "DeleteVnfInfra", "DELVI_cascadeDelete"); String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; String inUse = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "DELVI_vnfInUse"); @@ -112,7 +112,7 @@ public class DeleteVnfInfraTest extends WorkflowTest { Map<String, String> variables = new HashMap<>(); setVariables(variables, deleteVnfInfraRequestCascadeDelete, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); @@ -143,7 +143,7 @@ public class DeleteVnfInfraTest extends WorkflowTest { setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); @@ -177,7 +177,7 @@ public class DeleteVnfInfraTest extends WorkflowTest { setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java index f7cf3f480b..4161431297 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java @@ -187,7 +187,7 @@ public class ReplaceVnfInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
//injectSDNCCallbacks(callbacks, "deactivate");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java index 7a43bbd771..80a4518599 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java @@ -99,7 +99,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest { System.out.println("----------------------------------------------------------"); System.out.println("- got workflow response -"); System.out.println("----------------------------------------------------------"); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest")); @@ -146,7 +146,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariablesVIPER1(); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest")); @@ -196,7 +196,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariablesMissingNetworkId(); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest")); @@ -260,7 +260,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest { Map<String, String> variables = setupVariablesVID1(); //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID()); + //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest")); diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java index 37c548abf7..63cf62d17d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java @@ -101,7 +101,7 @@ public class UpdateVfModuleInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectSDNCCallbacks(callbacks, "changeassign, query");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java index b24eb56058..91327b087e 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java @@ -84,7 +84,7 @@ public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleVolumeInfraV1", "v1", businessKey, updaetVfModuleVolRequest, testVariables);
WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectVNFRestCallbacks(callbacks, "volumeGroupUpdate");
@@ -130,7 +130,7 @@ public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest { TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleVolumeInfraV1", "v1", businessKey, updaetVfModuleVolRequest, testVariables);
WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectVNFRestCallbacks(callbacks, "volumeGroupUpdate");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java index 36e9f2bfac..5ab1a04809 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java @@ -137,7 +137,7 @@ public class UpdateVnfInfraTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getResponse();
+ String responseBody = response.getContent();
System.out.println("Workflow (Synch) Response:\n" + responseBody);
injectSDNCCallbacks(callbacks, "changeassign, query");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java index 1a1e37714a..aca60026dc 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java @@ -117,7 +117,7 @@ public class VnfConfigUpdateTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); // TODO add appropriate assertions diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java index 17c48191c3..7d8a7e1856 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java @@ -132,7 +132,7 @@ public class VnfInPlaceUpdateTest extends WorkflowTest { WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - String responseBody = response.getResponse(); + String responseBody = response.getContent(); System.out.println("Workflow (Synch) Response:\n" + responseBody); // TODO add appropriate assertions diff --git a/common/src/main/java/org/openecomp/mso/utils/RootIgnoringJsonDeserializer.java b/common/src/main/java/org/openecomp/mso/utils/RootIgnoringJsonDeserializer.java new file mode 100644 index 0000000000..95f72c4dd4 --- /dev/null +++ b/common/src/main/java/org/openecomp/mso/utils/RootIgnoringJsonDeserializer.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.utils; + +import java.io.IOException; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * A JSON deserializer that ignores the root element if it is present. + */ +public class RootIgnoringJsonDeserializer<T> extends JsonDeserializer<T> { + + private final ObjectMapper mapper = new ObjectMapper(); + private final Class<T> clazz; + private final String jsonRootName; + + public RootIgnoringJsonDeserializer(Class<T> clazz) { + this.clazz = clazz; + + JsonRootName annotation = clazz.getAnnotation(JsonRootName.class); + + if (annotation == null || annotation.value() == null || annotation.value().equals("")) { + jsonRootName = clazz.getSimpleName(); + } else { + jsonRootName = annotation.value(); + } + } + + @Override + public T deserialize(JsonParser jp, DeserializationContext dc) + throws IOException, JsonProcessingException { + JsonNode rootNode = jp.getCodec().readTree(jp); + Map.Entry<String,JsonNode> field = rootNode.fields().next(); + + if (jsonRootName.equals(field.getKey())) { + rootNode = field.getValue(); + } + + return mapper.convertValue(rootNode, clazz); + } +}
\ No newline at end of file diff --git a/common/src/main/java/org/openecomp/mso/utils/RootIgnoringObjectMapper.java b/common/src/main/java/org/openecomp/mso/utils/RootIgnoringObjectMapper.java new file mode 100644 index 0000000000..6f3c5b7d99 --- /dev/null +++ b/common/src/main/java/org/openecomp/mso/utils/RootIgnoringObjectMapper.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.utils; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; + +/** + * An ObjectMapper for a specific class that ignores the root element + * if it is present. + */ +public class RootIgnoringObjectMapper<T> extends ObjectMapper { + + private static final long serialVersionUID = 6812584067195377395L; + + public RootIgnoringObjectMapper(Class<T> clazz) { + SimpleModule module = new SimpleModule(); + module.addDeserializer(clazz, new RootIgnoringJsonDeserializer<T>(clazz)); + registerModule(module); + } +}
\ No newline at end of file diff --git a/common/src/test/java/org/openecomp/mso/utils/RootIgnoringObjectMapperTest.java b/common/src/test/java/org/openecomp/mso/utils/RootIgnoringObjectMapperTest.java new file mode 100644 index 0000000000..1c7e845f16 --- /dev/null +++ b/common/src/test/java/org/openecomp/mso/utils/RootIgnoringObjectMapperTest.java @@ -0,0 +1,94 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.utils; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class RootIgnoringObjectMapperTest { + + @Test + public void someObjectWithoutRootTest() throws Exception { + ObjectMapper mapper = new RootIgnoringObjectMapper<SomeObject>(SomeObject.class); + + String content = "{" + + "\"attribute\":\"charm\"" + + "}"; + + SomeObject response = mapper.readValue(content, SomeObject.class); + assertEquals("SomeObject[attribute=charm]", response.toString()); + } + + @Test + public void someObjectWithRootTest() throws Exception { + ObjectMapper mapper = new RootIgnoringObjectMapper<SomeObject>(SomeObject.class); + + String content = "{\"SomeObject\":{" + + "\"attribute\":\"charm\"" + + "}}"; + + SomeObject response = mapper.readValue(content, SomeObject.class); + assertEquals("SomeObject[attribute=charm]", response.toString()); + } + + @Test + public void annotatedObjectWithoutRootTest() throws Exception { + ObjectMapper mapper = new RootIgnoringObjectMapper<AnnotatedObject>(AnnotatedObject.class); + + String content = "{" + + "\"attribute\":\"charm\"" + + "}"; + + AnnotatedObject response = mapper.readValue(content, AnnotatedObject.class); + assertEquals("AnnotatedObject[attribute=charm]", response.toString()); + } + + @Test + public void annotatedObjectWithRootTest() throws Exception { + ObjectMapper mapper = new RootIgnoringObjectMapper<AnnotatedObject>(AnnotatedObject.class); + + String content = "{\"annotated-object\":{" + + "\"attribute\":\"charm\"" + + "}}"; + + AnnotatedObject response = mapper.readValue(content, AnnotatedObject.class); + assertEquals("AnnotatedObject[attribute=charm]", response.toString()); + } + + public static class SomeObject { + + @JsonProperty("attribute") + private String attribute; + + public String toString() { + return getClass().getSimpleName() + "[attribute=" + attribute + "]"; + } + } + + @JsonRootName(value = "annotated-object") + public static class AnnotatedObject extends SomeObject { + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaResponse.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaResponse.java index 3c5c5ecb1d..64b7d86b59 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaResponse.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaResponse.java @@ -20,53 +20,41 @@ package org.openecomp.mso.apihandler.camundabeans; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +// This class must be 100% JSON-compatible with the BPMN WorkflowResponse class. +// TODO: BPMN and the API-H should use a common class. /** - * JavaBean JSON class for a "variables" which contains the xml payload that - * will be passed to the Camunda process - * + * A synchronous response from a workflow. */ - +@JsonRootName(value = "WorkflowResponse") public class CamundaResponse { - - @JsonProperty("response") - private String response; + + @JsonProperty("processInstanceId") + private String processInstanceId; + @JsonProperty("messageCode") private int messageCode; + @JsonProperty("message") private String message; - @JsonProperty("processInstanceID") - private String processInstanceID; - @JsonProperty("variables") - private String variables; - public String getProcessInstanceID() { - return processInstanceID; - } - - public void setProcessInstanceID(String processInstanceID) { - this.processInstanceID = processInstanceID; - } - - public String getVariables() { - return variables; - } - - public void setVariables(String variables) { - this.variables = variables; - } + @JsonProperty("variables") + private Map<String,String> variables; - public CamundaResponse() { - } + @JsonProperty("content") + private String content; - public String getResponse() { - return response; + public String getProcessInstanceId() { + return processInstanceId; } - public void setResponse(String response) { - this.response = response; + public void setProcessInstanceId(String processInstanceId) { + this.processInstanceId = processInstanceId; } public int getMessageCode() { @@ -85,13 +73,30 @@ public class CamundaResponse { this.message = message; } + public Map<String,String> getVariables() { + return variables; + } + + public void setVariables(Map<String,String> variables) { + this.variables = variables; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + @Override public String toString() { - return "CamundaResponse [response=" + response + ", messageCode=" - + messageCode + ", message=" + message + "]"; + return getClass().getSimpleName() + "[" + + "processInstanceId=" + processInstanceId + + ",messageCode=" + messageCode + + ",message=" + message + + ",variables=" + variables + + ",content=" + content + + "]"; } - - - - -} +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java index 732b7786b2..a8b8984343 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java @@ -27,21 +27,22 @@ import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.util.EntityUtils; -import com.fasterxml.jackson.databind.ObjectMapper; - import org.openecomp.mso.apihandler.camundabeans.CamundaResponse; -import org.openecomp.mso.logger.MsoLogger; import org.openecomp.mso.logger.MessageEnum; +import org.openecomp.mso.logger.MsoLogger; +import org.openecomp.mso.utils.RootIgnoringObjectMapper; + +import com.fasterxml.jackson.databind.ObjectMapper; public class ResponseHandler { private CamundaResponse response; private int status; - private String responseBody=""; + private String content = ""; private HttpResponse httpResponse; private int type; private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH); - private static final String RESPONSE_BODY_MSG = "response body is: "; + private static final String RESPONSE_CONTENT_MSG = "response content is: "; public ResponseHandler(HttpResponse httpResponse, int type) { this.httpResponse = httpResponse; @@ -67,29 +68,31 @@ public class ResponseHandler { + @SuppressWarnings("unchecked") private void parseCamunda(){ try{ - HttpEntity entity = httpResponse.getEntity(); - responseBody = EntityUtils.toString(entity); - } catch (IOException e) { - msoLogger.debug("IOException getting Camunda response body", e); - } - - ObjectMapper mapper = new ObjectMapper(); - try { - response = mapper.readValue(responseBody, CamundaResponse.class); - } catch (IOException e) { - msoLogger.debug("IOException getting Camunda response body", e); - } - msoLogger.debug("json response is: " + responseBody); - if(response!=null){ - responseBody = response.getResponse(); - } - msoLogger.debug(RESPONSE_BODY_MSG + responseBody); - - + HttpEntity entity = httpResponse.getEntity(); + content = EntityUtils.toString(entity); + } catch (IOException e) { + msoLogger.debug("IOException getting Camunda response content", e); + } + + ObjectMapper mapper = new RootIgnoringObjectMapper<CamundaResponse>(CamundaResponse.class); + + try { + response = mapper.readValue(content, CamundaResponse.class); + } catch (IOException e) { + msoLogger.debug("IOException getting Camunda response content", e); + } + msoLogger.debug("json response is: " + content); + if(response!=null){ + content = response.getContent(); + } + msoLogger.debug(RESPONSE_CONTENT_MSG + content); + + if(status!=HttpStatus.SC_ACCEPTED){ - msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "Camunda", String.valueOf(status), responseBody, "Camunda", "parseCamunda", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda"); + msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "Camunda", String.valueOf(status), content, "Camunda", "parseCamunda", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda"); } } @@ -99,16 +102,16 @@ public class ResponseHandler { try { if (bpelEntity!=null) { - responseBody = EntityUtils.toString(bpelEntity); - msoLogger.debug(RESPONSE_BODY_MSG + responseBody); + content = EntityUtils.toString(bpelEntity); + msoLogger.debug(RESPONSE_CONTENT_MSG + content); } if(status!=HttpStatus.SC_ACCEPTED){ - msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "BPEL", String.valueOf(status), responseBody, "BPEL", "parseBpel", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from BPEL"); + msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "BPEL", String.valueOf(status), content, "BPEL", "parseBpel", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from BPEL"); } } catch (IOException e) { - msoLogger.debug("IOException getting BPEL response body", e); + msoLogger.debug("IOException getting BPEL response content", e); } } @@ -118,16 +121,16 @@ public class ResponseHandler { try { if (camundataskEntity!=null) { - responseBody = EntityUtils.toString(camundataskEntity); - msoLogger.debug(RESPONSE_BODY_MSG + responseBody); + content = EntityUtils.toString(camundataskEntity); + msoLogger.debug(RESPONSE_CONTENT_MSG + content); } if(status!=HttpStatus.SC_NO_CONTENT && status != HttpStatus.SC_ACCEPTED){ - msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "CAMUNDATASK", String.valueOf(status), responseBody, "CAMUNDATASK", "parseCamundaTask", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda Task"); + msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "CAMUNDATASK", String.valueOf(status), content, "CAMUNDATASK", "parseCamundaTask", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda Task"); } } catch (IOException e) { - msoLogger.debug("IOException getting Camunda Task response body", e); + msoLogger.debug("IOException getting Camunda Task response content", e); } } @@ -175,18 +178,17 @@ public class ResponseHandler { } - public String getResponseBody() { - return responseBody; + public String getContent() { + return content; } - public void setResponseBody(String responseBody) { - this.responseBody = responseBody; + public void setContent(String content) { + this.content = content; } public int getStatus() { return status; } - } diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaResponseTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaResponseTest.java index 9b36a984b1..7fc2815b4b 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaResponseTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaResponseTest.java @@ -23,14 +23,10 @@ package org.openecomp.mso.camunda.tests; import static org.junit.Assert.assertEquals; -import java.io.IOException; - import org.junit.Test; import org.openecomp.mso.apihandler.camundabeans.CamundaResponse; +import org.openecomp.mso.utils.RootIgnoringObjectMapper; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; /** @@ -41,19 +37,42 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class CamundaResponseTest { @Test - public final void testDeserialization() throws JsonGenerationException, - JsonMappingException, IOException { - ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally - mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); - - String responseBody = "{ \"response\": \"<xml>xml</xml>\","+ - "\"messageCode\": 200,"+ - "\"message\": \"Successfully started the process\"," + - "\"processInstanceID\":null,\"variables\":null}"; - - CamundaResponse response = mapper.readValue(responseBody, CamundaResponse.class); - assertEquals(response.toString(), "CamundaResponse [response=<xml>xml</xml>, messageCode=200, message=Successfully started the process]"); + public final void testDeserializationWithoutRootElement() throws Exception { + + ObjectMapper mapper = new RootIgnoringObjectMapper<CamundaResponse>(CamundaResponse.class); + + String content = "{" + + "\"messageCode\":202" + + ",\"message\":\"Successfully started the process\"" + + ",\"content\":\"<xml>xml</xml>\"" + + ",\"processInstanceId\":\"4d3b3201a7ce\"" + + ",\"variables\":null" + + "}"; + CamundaResponse response = mapper.readValue(content, CamundaResponse.class); + + assertEquals( + "CamundaResponse[processInstanceId=4d3b3201a7ce,messageCode=202,message=Successfully started the process,variables=null,content=<xml>xml</xml>]", + response.toString()); } -} + @Test + public final void testDeserializationWithRootElement() throws Exception { + + ObjectMapper mapper = new RootIgnoringObjectMapper<CamundaResponse>(CamundaResponse.class); + + String content = "{\"WorkflowResponse\":{" + + "\"messageCode\":202" + + ",\"message\":\"Successfully started the process\"" + + ",\"content\":\"<xml>xml</xml>\"" + + ",\"processInstanceId\":\"4d3b3201a7ce\"" + + ",\"variables\":null" + + "}}"; + + CamundaResponse response = mapper.readValue(content, CamundaResponse.class); + + assertEquals( + "CamundaResponse[processInstanceId=4d3b3201a7ce,messageCode=202,message=Successfully started the process,variables=null,content=<xml>xml</xml>]", + response.toString()); + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java index d0031f3946..e04aba0ede 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java @@ -47,13 +47,15 @@ public class ResponseHandlerTest { @Test public void tesParseCamundaResponse () throws JsonGenerationException, JsonMappingException, IOException { - // String body - // ="{\"links\":[{\"method\":\"GET\",\"href\":\"http://localhost:9080/engine-rest/process-instance/2047c658-37ae-11e5-9505-7a1020524153\",\"rel\":\"self\"}],\"id\":\"2047c658-37ae-11e5-9505-7a1020524153\",\"definitionId\":\"dummy:10:73298961-37ad-11e5-9505-7a1020524153\",\"businessKey\":null,\"caseInstanceId\":null,\"ended\":true,\"suspended\":false}"; - String body = "{ \"response\": \"<xml>xml</xml>\"," + "\"messageCode\": 200," - + "\"message\": \"Successfully started the process\"}"; + String content = "{\"WorkflowResponse\":{" + + "\"messageCode\":202" + + ",\"message\":\"Successfully started the process\"" + + ",\"content\":\"<xml>xml</xml>\"" + + ",\"processInstanceId\":\"4d3b3201a7ce\"" + + "}}"; - HttpResponse response = createResponse (200, body, "application/json"); + HttpResponse response = createResponse (200, content, "application/json"); ResponseHandler respHandler = new ResponseHandler (response, 1); @@ -81,7 +83,7 @@ public class ResponseHandlerTest { int status = respHandler.getStatus (); assertEquals (status, HttpStatus.SC_ACCEPTED); - assertTrue (respHandler.getResponseBody () != null); + assertTrue (respHandler.getContent() != null); } @Test @@ -100,17 +102,21 @@ public class ResponseHandlerTest { @Test public void tesGenricErrorResponse () throws JsonGenerationException, JsonMappingException, IOException { - String body = "{ \"response\": \"<xml>xml</xml>\"," + "\"messageCode\": 500," - + "\"message\": \"Something went wrong\"}"; + String content = "{\"WorkflowResponse\":{" + + "\"messageCode\":500" + + ",\"message\":\"Something went wrong\"" + + ",\"content\":\"<xml>xml</xml>\"" + + ",\"processInstanceId\":\"4d3b3201a7ce\"" + + "}}"; - HttpResponse response = createResponse (500, body, "application/json"); + HttpResponse response = createResponse (500, content, "application/json"); ResponseHandler respHandler = new ResponseHandler (response, 1); int status = respHandler.getStatus (); assertEquals (HttpStatus.SC_BAD_GATEWAY, status); assertEquals (respHandler.getResponse ().getMessage (), "Something went wrong"); - System.out.println (respHandler.getResponseBody ()); + System.out.println (respHandler.getContent()); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java index ccaf954aa1..23adafd08e 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java @@ -985,7 +985,7 @@ public class E2EServiceInstances { HashMap<String, String> instanceIdMap) { // BPMN accepted the request, the request is in progress if (bpelStatus == HttpStatus.SC_ACCEPTED) { - String camundaJSONResponseBody = respHandler.getResponseBody(); + String camundaJSONResponseBody = respHandler.getContent(); msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody); msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, @@ -996,7 +996,7 @@ public class E2EServiceInstances { } else { List<String> variables = new ArrayList<>(); variables.add(bpelStatus + ""); - String camundaJSONResponseBody = respHandler.getResponseBody(); + String camundaJSONResponseBody = respHandler.getContent(); if (camundaJSONResponseBody != null && !camundaJSONResponseBody.isEmpty()) { Response resp = msoRequest.buildServiceErrorResponse( diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java index 7c3a3df0e2..9cba623642 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java @@ -798,7 +798,7 @@ public class ServiceInstances { // BPEL accepted the request, the request is in progress if (bpelStatus == HttpStatus.SC_ACCEPTED) { - String camundaJSONResponseBody = respHandler.getResponseBody (); + String camundaJSONResponseBody = respHandler.getContent(); msoLogger.debug ("Received from Camunda: " + camundaJSONResponseBody); msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.IN_PROGRESS); (RequestsDatabase.getInstance()).updateInfraStatus (msoRequest.getRequestId (), @@ -811,7 +811,7 @@ public class ServiceInstances { } else { List<String> variables = new ArrayList<>(); variables.add(bpelStatus + ""); - String camundaJSONResponseBody = respHandler.getResponseBody (); + String camundaJSONResponseBody = respHandler.getContent(); if (camundaJSONResponseBody != null && !camundaJSONResponseBody.isEmpty ()) { msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); Response resp = msoRequest.buildServiceErrorResponse(bpelStatus, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java index 368807f9c9..9aac16aa4c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java @@ -176,7 +176,7 @@ public class TasksHandler { msoLogger.debug ("Received good response from Camunda"); msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "BPMN completed the request"); - String respBody = respHandler.getResponseBody(); + String respBody = respHandler.getContent(); if (respBody != null) { JSONArray data = new JSONArray(respBody); @@ -276,7 +276,7 @@ public class TasksHandler { msoLogger.debug ("Received good response from Camunda"); msoLogger.recordAuditEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "BPMN completed the request"); - String respBody = respHandler.getResponseBody(); + String respBody = respHandler.getContent(); if (respBody != null) { taskList = buildTaskList(taskId, respBody); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java index f8caa54846..60ac6b98c9 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java @@ -204,7 +204,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -268,7 +268,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 500, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -333,7 +333,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 500, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"\",\"message\":\"success\"}"; + String body = "{\"content\":\"\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -634,7 +634,7 @@ public class E2EServiceInstancesTest { ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1); HttpResponse resp = new BasicHttpResponse(pv, 200, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -832,7 +832,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -898,7 +898,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -965,7 +965,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -1037,7 +1037,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -1103,7 +1103,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -1227,7 +1227,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "compareModelwithTargetVersion, test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); @@ -1301,7 +1301,7 @@ public class E2EServiceInstancesTest { HttpResponse resp = new BasicHttpResponse(pv, 202, "test response"); BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; + String body = "{\"content\":\"success\",\"message\":\"success\"}"; InputStream instream = new ByteArrayInputStream(body.getBytes()); entity.setContent(instream); resp.setEntity(entity); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java index 28cb51aa70..50f00ef6a4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java @@ -233,7 +233,7 @@ public class ServiceInstanceTest { ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
- String body = "{\"response\":\"success\",\"message\":\"success\"}";
+ String body = "{\"content\":\"success\",\"message\":\"success\"}";
InputStream instream = new ByteArrayInputStream(body.getBytes());
entity.setContent(instream);
resp.setEntity(entity);
@@ -303,7 +303,7 @@ public class ServiceInstanceTest { ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
- String body = "{\"response\":\"success\",\"message\":\"success\"}";
+ String body = "{\"content\":\"success\",\"message\":\"success\"}";
InputStream instream = new ByteArrayInputStream(body.getBytes());
entity.setContent(instream);
resp.setEntity(entity);
@@ -374,7 +374,7 @@ public class ServiceInstanceTest { ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
- String body = "{\"response\":\"success\",\"message\":\"success\"}";
+ String body = "{\"content\":\"success\",\"message\":\"success\"}";
InputStream instream = new ByteArrayInputStream(body.getBytes());
entity.setContent(instream);
resp.setEntity(entity);
@@ -932,7 +932,7 @@ public class ServiceInstanceTest { HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
- final String body = "{\"response\":\"success\",\"message\":\"success\"}";
+ final String body = "{\"content\":\"success\",\"message\":\"success\"}";
InputStream instream = new ByteArrayInputStream(body.getBytes());
entity.setContent(instream);
resp.setEntity(entity);
@@ -1101,7 +1101,7 @@ public class ServiceInstanceTest { HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
- final String body = "{\"response\":\"success\",\"message\":\"success\"}";
+ final String body = "{\"content\":\"success\",\"message\":\"success\"}";
InputStream instream = new ByteArrayInputStream(body.getBytes());
entity.setContent(instream);
resp.setEntity(entity);
@@ -1152,7 +1152,7 @@ public class ServiceInstanceTest { HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
- final String body = "{\"response\":\"success\",\"message\":\"success\"}";
+ final String body = "{\"content\":\"success\",\"message\":\"success\"}";
InputStream instream = new ByteArrayInputStream(body.getBytes());
entity.setContent(instream);
resp.setEntity(entity);
|