diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2024-07-03 16:30:10 +0100 |
---|---|---|
committer | Francesco Fiora <francesco.fiora@est.tech> | 2024-07-04 09:00:12 +0000 |
commit | e0d7e568c86b612852372d566bddb97585ae5cad (patch) | |
tree | 7805acd678442b51ab4683b141ddcd6115c8b0cb /participant/participant-impl/participant-impl-policy | |
parent | e7772aebff2f84a619788ddb287fbfcef8569964 (diff) |
Update policy-api status response check in ACM policy-participant
Issue-ID:POLICY-5067
Change-Id: Ibd9416226619b32bae09008c92962b1b186cb0e9
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-policy')
-rw-r--r-- | participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java index 34c195501..5a3bc6328 100644 --- a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java +++ b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java @@ -182,7 +182,7 @@ public class AutomationCompositionElementHandler extends AcElementListenerV2 { createPolicyResp = response.getStatus(); } } - if (createPolicyTypeResp == HttpStatus.SC_OK && createPolicyResp == HttpStatus.SC_OK) { + if (isSuccess(createPolicyTypeResp) && isSuccess(createPolicyResp)) { LOGGER.info( "PolicyTypes/Policies for the automation composition element : {} are created " + "successfully", instanceElement.elementId()); @@ -195,6 +195,10 @@ public class AutomationCompositionElementHandler extends AcElementListenerV2 { } } + private boolean isSuccess(int status) { + return status == HttpStatus.SC_OK || status == HttpStatus.SC_CREATED; + } + private List<ToscaConceptIdentifier> getPolicyTypeList(ToscaServiceTemplate serviceTemplate) { List<ToscaConceptIdentifier> policyTypeList = new ArrayList<>(); if (serviceTemplate.getPolicyTypes() != null) { |