summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.so
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-03-02 16:17:36 -0500
committerJim Hahn <jrh3@att.com>2020-03-03 01:12:53 +0000
commit9bd821d6a2b49dacb7286d58f11d5cd1cc7e0aa2 (patch)
treeed9218821be37c3f060eb3dc64b7f89327f70164 /models-interactions/model-actors/actor.so
parentd5fc0bddf4f1e02d47a95d070c000ff0a6557edd (diff)
Fix path issues
A&AI tenant query is prepending the target entity with "/", but it should not. Fixed it. Modified A&AI and SO actors to get path prefixes from parameters. Fixed a bug in an A&AI simulator response (extra "}" at the end. Issue-ID: POLICY-2349 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I71f8b1e5fb8a4bd29b4f616a7757d366c7d58127
Diffstat (limited to 'models-interactions/model-actors/actor.so')
-rw-r--r--models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleCreate.java8
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java2
-rw-r--r--models-interactions/model-actors/actor.so/src/test/resources/service.yaml4
3 files changed, 6 insertions, 8 deletions
diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleCreate.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleCreate.java
index fb8fe6072..4c35f9abe 100644
--- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleCreate.java
+++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleCreate.java
@@ -107,7 +107,7 @@ public class VfModuleCreate extends SoOperation {
resetGetCount();
Pair<String, SoRequest> pair = makeRequest();
- String path = pair.getLeft();
+ String path = getPath() + pair.getLeft();
SoRequest request = pair.getRight();
Entity<SoRequest> entity = Entity.entity(request, MediaType.APPLICATION_JSON);
@@ -115,8 +115,6 @@ public class VfModuleCreate extends SoOperation {
logMessage(EventType.OUT, CommInfrastructure.REST, url, request);
- // TODO should this use "path" or the full "url"?
-
return handleResponse(outcome, url, callback -> getClient().post(callback, path, entity, null));
}
@@ -208,8 +206,8 @@ public class VfModuleCreate extends SoOperation {
buildConfigurationParameters().ifPresent(request.getRequestDetails()::setConfigurationParameters);
// compute the path
- String path = "/serviceInstantiation/v7/serviceInstances/" + vnfServiceItem.getServiceInstanceId() + "/vnfs/"
- + vnfItem.getVnfId() + "/vfModules/scaleOut";
+ String path = "/serviceInstances/" + vnfServiceItem.getServiceInstanceId() + "/vnfs/" + vnfItem.getVnfId()
+ + "/vfModules/scaleOut";
return Pair.of(path, request);
}
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java
index 98c645b16..8bd607f32 100644
--- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java
+++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java
@@ -202,7 +202,7 @@ public class VfModuleCreateTest extends BasicSoOperation {
// @formatter:off
assertEquals(
- "/serviceInstantiation/v7/serviceInstances/my-service-instance-id/vnfs/my-vnf-id/vfModules/scaleOut",
+ "/serviceInstances/my-service-instance-id/vnfs/my-vnf-id/vfModules/scaleOut",
pair.getLeft());
// @formatter:on
diff --git a/models-interactions/model-actors/actor.so/src/test/resources/service.yaml b/models-interactions/model-actors/actor.so/src/test/resources/service.yaml
index b1ac162a4..4bf074fc5 100644
--- a/models-interactions/model-actors/actor.so/src/test/resources/service.yaml
+++ b/models-interactions/model-actors/actor.so/src/test/resources/service.yaml
@@ -21,11 +21,11 @@ httpClients:
- clientName: my-client
hostname: localhost
port: 80
- basePath: base-url
+ basePath: base-url/
managed: true
actors:
SO:
clientName: my-client
operations:
VF Module Create:
- path: create \ No newline at end of file
+ path: serviceInstantiation/v7 \ No newline at end of file