summaryrefslogtreecommitdiffstats
path: root/prh-commons
diff options
context:
space:
mode:
Diffstat (limited to 'prh-commons')
-rw-r--r--prh-commons/pom.xml2
-rw-r--r--prh-commons/src/main/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiGetServiceInstanceClient.java8
-rw-r--r--prh-commons/src/test/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiClientConfigurations.java6
3 files changed, 10 insertions, 6 deletions
diff --git a/prh-commons/pom.xml b/prh-commons/pom.xml
index 5cb5165e..cc4b6e8d 100644
--- a/prh-commons/pom.xml
+++ b/prh-commons/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.onap.dcaegen2.services</groupId>
<artifactId>prh</artifactId>
- <version>1.6.1-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.dcaegen2.services.prh</groupId>
diff --git a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiGetServiceInstanceClient.java b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiGetServiceInstanceClient.java
index 26fb8491..93efa8c3 100644
--- a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiGetServiceInstanceClient.java
+++ b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiGetServiceInstanceClient.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* DCAEGEN2-SERVICES-SDK
* ================================================================================
- * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 NOKIA 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.
@@ -41,6 +41,9 @@ public class AaiGetServiceInstanceClient implements
private static final String SERVICE_TYPE = "serviceType";
private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
+ private static final String VARIABLE_PREFIX = "{{";
+ private static final String VARIABLE_SUFFIX = "}}";
+
private final RxHttpClient httpClient;
private final AaiClientConfiguration configuration;
@@ -57,7 +60,8 @@ public class AaiGetServiceInstanceClient implements
SERVICE_TYPE, aaiModel.serviceType(),
SERVICE_INSTANCE_ID, aaiModel.serviceInstanceId());
- final StringSubstitutor substitutor = new StringSubstitutor(mapping.toJavaMap());
+ final StringSubstitutor substitutor =
+ new StringSubstitutor(mapping.toJavaMap(), VARIABLE_PREFIX, VARIABLE_SUFFIX);
final String endpoint = substitutor.replace(configuration.aaiServiceInstancePath());
return httpClient.call(ImmutableHttpRequest.builder()
diff --git a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiClientConfigurations.java b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiClientConfigurations.java
index fa04804b..2f3dba03 100644
--- a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiClientConfigurations.java
+++ b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/adapter/aai/impl/AaiClientConfigurations.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* DCAEGEN2-SERVICES-SDK
* ================================================================================
- * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 NOKIA 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.
@@ -54,7 +54,7 @@ public final class AaiClientConfigurations {
.enableAaiCertAuth(secure)
.aaiHeaders(headers)
.aaiServiceInstancePath(
- "/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}")
+ "/business/customers/customer/{{customer}}/service-subscriptions/service-subscription/{{serviceType}}/service-instances/service-instance/{{serviceInstanceId}}")
.build();
}
-} \ No newline at end of file
+}