diff options
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java index 8640332d..7f9d690d 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java @@ -54,7 +54,8 @@ import org.slf4j.LoggerFactory; public class LifecycleApiPolicyForwarder implements PolicyForwarder { private static final String DEPLOY_POLICY_URI = "/policy/pap/v1/pdps/policies"; - private static final String CREATE_POLICY_TYPE_URI = "/policy/api/v1/policytypes/"; + private static final String CREATE_POLICY_TYPE_URI = "/policy/api/v1/policytypes"; + private static final String CREATE_POLICY_URI = "/policy/api/v1/policies"; private static final Logger LOGGER = LoggerFactory.getLogger(LifecycleApiPolicyForwarder.class); private LifecycleApiForwarderParameters forwarderParameters; @@ -120,10 +121,8 @@ public class LifecycleApiPolicyForwarder implements PolicyForwarder { } private Response createPolicy(final ToscaServiceTemplate toscaServiceTemplate) throws PolicyForwardingException { - final ToscaPolicy policy = toscaServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).entrySet() - .iterator().next().getValue(); return invokeHttpClient(Entity.entity(toscaServiceTemplate, MediaType.APPLICATION_JSON), - CREATE_POLICY_TYPE_URI + policy.getType() + "/versions/" + policy.getTypeVersion() + "/policies", true); + CREATE_POLICY_URI, true); } private Response deployPolicy(final ToscaServiceTemplate toscaServiceTemplate) throws PolicyForwardingException { diff --git a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java index 2b38434c..4a881cb0 100644 --- a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java +++ b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2021 Bell Canada. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +65,7 @@ public class LifecycycleApiSimulatorEndpoint { * @return the response object */ @POST - @Path("/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies") + @Path("/api/v1/policies") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createPolicies(@PathParam("policyTypeId") final String policyTypeId, |