summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java10
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operation/DmiOperationsSpec.groovy8
-rw-r--r--cps-ncmp-service/src/test/resources/application.yml22
3 files changed, 9 insertions, 31 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java
index 8896b9fd5..d6feaf3ad 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java
@@ -48,7 +48,7 @@ public class DmiOperations {
}
private DmiRestClient dmiRestClient;
- private static final String DMI_API_PATH = "/dmi/api";
+ private static final String DMI_API_PATH = "/dmi";
private static final String DMI_CM_HANDLE_PATH = "/v1/ch/{cmHandle}";
private static final String DMI_CM_HANDLE_DATASTORE_PATH = DMI_CM_HANDLE_PATH + "/data/ds";
private static final String URL_SEPARATOR = "/";
@@ -65,7 +65,7 @@ public class DmiOperations {
/**
* Get resources from DMI.
*
- * @param dmiServiceName dmi base path
+ * @param dmiServiceName dmi service name
* @param cmHandle cmHandle
* @param resourceName name of the resource(s)
* @return {@code ResponseEntity} response entity
@@ -135,17 +135,17 @@ public class DmiOperations {
* This method creates the resource data from pass-through running data store for given cm handle
* identifier on given resource using dmi client.
*
- * @param dmiBasePath dmi base path
+ * @param dmiServiceName dmi service name
* @param cmHandle network resource identifier
* @param resourceId resource identifier
* @param jsonBody json body for put operation
* @return {@code ResponseEntity} response entity
*/
- public ResponseEntity<Void> createResourceDataPassThroughRunningFromDmi(final String dmiBasePath,
+ public ResponseEntity<Void> createResourceDataPassThroughRunningFromDmi(final String dmiServiceName,
final String cmHandle,
final String resourceId,
final String jsonBody) {
- final var stringBuilder = getStringBuilderForPassThroughRunningUrl(dmiBasePath,
+ final var stringBuilder = getStringBuilderForPassThroughRunningUrl(dmiServiceName,
cmHandle, resourceId, DataStoreEnum.PASSTHROUGH_RUNNING);
return dmiRestClient.postOperationWithJsonData(stringBuilder.toString(), jsonBody, new HttpHeaders());
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operation/DmiOperationsSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operation/DmiOperationsSpec.groovy
index 3c9b16440..987ab2bca 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operation/DmiOperationsSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operation/DmiOperationsSpec.groovy
@@ -41,7 +41,7 @@ class DmiOperationsSpec extends Specification {
def 'call get resource data for pass-through:operational datastore from DMI.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/data/ds' +
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
'/ncmp-datastore:passthrough-operational/testResourceId?fields=testFieldsQuery&depth=10'
when: 'get resource data is called to DMI'
objectUnderTest.getResourceDataOperationalFromDmi('testDmiBasePath',
@@ -56,7 +56,7 @@ class DmiOperationsSpec extends Specification {
}
def 'call get resource data for pass-through:running datastore from DMI.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/data/ds' +
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
'/ncmp-datastore:passthrough-running/testResourceId?fields=testFieldsQuery&depth=10'
when: 'get resource data is called to DMI'
objectUnderTest.getResourceDataPassThroughRunningFromDmi('testDmiBasePath',
@@ -71,7 +71,7 @@ class DmiOperationsSpec extends Specification {
}
def 'call create resource data for pass-through:running datastore from DMI.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/data/ds' +
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
'/ncmp-datastore:passthrough-running/testResourceId'
when: 'get resource data is called to DMI'
objectUnderTest.createResourceDataPassThroughRunningFromDmi('testDmiBasePath',
@@ -84,7 +84,7 @@ class DmiOperationsSpec extends Specification {
def 'Call get resource from dmi.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/modules'
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/modules'
when: 'get resource data is called to dmi'
objectUnderTest.getResourceFromDmi('testDmiBasePath',
'testCmhandle',
diff --git a/cps-ncmp-service/src/test/resources/application.yml b/cps-ncmp-service/src/test/resources/application.yml
deleted file mode 100644
index 8ffb8827f..000000000
--- a/cps-ncmp-service/src/test/resources/application.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-rest:
- api:
- ncmp-base-path: /cps-ncmp/api
-spring: