summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSébastien Determe <sebastien.determe@intl.att.com>2020-07-10 12:05:23 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-10 12:05:23 +0000
commit369ba144248faa94ba50669a6886745040e9475f (patch)
tree88d508856a9342d7151467ebe46ef473647d5fd2 /src
parentfa30aec1d332573f26ad5cd8324a1946273ac58d (diff)
parent1761c819d08244adaf3bbb36f053884c89d1a0db (diff)
Merge "Fix delete flow bug"
Diffstat (limited to 'src')
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml18
-rw-r--r--src/main/resources/clds/camel/routes/dcae-flows.xml8
-rw-r--r--src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java3
3 files changed, 25 insertions, 4 deletions
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index 99e92f5be..505ea30d9 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -200,6 +200,9 @@
<doTry>
<log loggingLevel="INFO"
message="DCAE DEPLOY request for loop: ${header.loopName}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" />
<to
@@ -330,6 +333,9 @@
<doTry>
<log loggingLevel="INFO"
message="DCAE UNDEPLOY request for loop: ${header.loopName}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" />
<to
@@ -373,6 +379,9 @@
<doTry>
<log loggingLevel="INFO"
message="STOP request for loop: ${header.loopName}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" />
<to
@@ -416,6 +425,9 @@
<doTry>
<log loggingLevel="INFO"
message="RESTART request for loop: ${header.loopName}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" />
<to
@@ -460,6 +472,9 @@
<doTry>
<log loggingLevel="INFO"
message="POLICY SUBMIT request for loop: ${header.loopName}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" />
<to
@@ -544,6 +559,9 @@
<doTry>
<log loggingLevel="INFO"
message="DELETE request for loop: ${header.loopName}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
<to
diff --git a/src/main/resources/clds/camel/routes/dcae-flows.xml b/src/main/resources/clds/camel/routes/dcae-flows.xml
index e36f28abf..d71db1763 100644
--- a/src/main/resources/clds/camel/routes/dcae-flows.xml
+++ b/src/main/resources/clds/camel/routes/dcae-flows.xml
@@ -239,7 +239,7 @@
method="getStatusUrl(${exchangeProperty[dcaeResponse]})" />
</setProperty>
<to
- uri="bean:org.onap.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},${exchangeProperty[microServicePolicy].getDcaeDeploymentId()},${exchangeProperty[dcaeStatusUrl]})" />
+ uri="bean:org.onap.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},null,${exchangeProperty[dcaeStatusUrl]})" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})" />
</when>
@@ -322,7 +322,7 @@
method="getStatusUrl(${exchangeProperty[dcaeResponse]})" />
</setProperty>
<to
- uri="bean:org.onap.clamp.loop.LoopService?method=updateDcaeDeploymentFields(${exchangeProperty[loopObject]},${exchangeProperty[loopObject].getDcaeDeploymentId()},${exchangeProperty[dcaeStatusUrl]})" />
+ uri="bean:org.onap.clamp.loop.LoopService?method=updateDcaeDeploymentFields(${exchangeProperty[loopObject]},null,${exchangeProperty[dcaeStatusUrl]})" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -378,9 +378,9 @@
</handled>
<log loggingLevel="ERROR"
- message="GET policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
+ message="GET DCAE deployment request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET policy request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
diff --git a/src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java b/src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java
index 07e7c4d7c..169db9db1 100644
--- a/src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java
+++ b/src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java
@@ -160,6 +160,7 @@ public class DeployFlowTestItCase {
Loop loopAfterTest = loopService.getLoop("ControlLoopTest");
assertThat(loopAfterTest.getDcaeDeploymentStatusUrl().contains("/uninstall")).isTrue();
+ assertThat(loopAfterTest.getDcaeDeploymentId()).isNull();
}
/**
@@ -196,6 +197,8 @@ public class DeployFlowTestItCase {
Set<MicroServicePolicy> policyList = loopAfterTest.getMicroServicePolicies();
for (MicroServicePolicy policy : policyList) {
assertThat(policy.getDcaeDeploymentStatusUrl().contains("/uninstall")).isTrue();
+ assertThat(policy.getDcaeDeploymentId()).isNull();
+
}
assertThat(loopAfterTest.getDcaeDeploymentStatusUrl()).isNull();
assertThat(loopAfterTest.getDcaeDeploymentId()).isNull();