aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorChuanyu Chen <chenchuanyu@huawei.com>2020-09-01 07:50:58 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-01 07:50:58 +0000
commit8130b6d10da62329f3f43b7819f40ecf02282ffa (patch)
tree4c7c9073f790ff489cc61b742ecf5809256639e1 /adapters
parentd2857ab5a83fe6485083d7af121e5b788ea25c13 (diff)
parent4d43829503cbd767b50a25549feab45947b6b7f5 (diff)
Merge "Update NSSMF adapter to support External RAN NSSMF"
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java4
-rw-r--r--adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java8
-rw-r--r--adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java4
4 files changed, 10 insertions, 8 deletions
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java
index e762bc04e8..28789f2a98 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java
@@ -50,7 +50,7 @@ public class NssmfAdapterConsts {
private final static String EXTERNAL_TN_DEALLOCATE_URL =
"/api/rest/provMns/{apiVersion}/tn/NSS/SliceProfiles/{sliceProfileId}";
- private final static String EXTERNAL_AN_DEALLOCATE_URL = "/ObjectManagement/NSS/SliceProfiles/{SliceProfileId}";
+ private final static String EXTERNAL_AN_DEALLOCATE_URL = "/ObjectManagement/NSS/SliceProfiles/{sliceProfileId}";
private final static String INTERNAL_DEALLOCATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/deAllocate";
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java
index 0d2f2dfdeb..ef979a660f 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java
@@ -41,7 +41,9 @@ public class ExternalAnNssmfManager extends ExternalNssmfManager {
@Override
protected String doWrapExtAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
- return marshal(nbiRequest.getAllocateAnNssi().getSliceProfile());
+ Map<String, Object> request = new HashMap<>();
+ request.put("attributeListIn", nbiRequest.getAllocateAnNssi().getSliceProfile());
+ return marshal(request);
}
@Override
diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
index a9c732e6e3..67cd913b3e 100644
--- a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
+++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
@@ -54,7 +54,7 @@ import org.onap.so.beans.nsmf.NssiAllocateRequest;
import org.onap.so.beans.nsmf.NssiDeAllocateRequest;
import org.onap.so.beans.nsmf.NssiResponse;
import org.onap.so.beans.nsmf.PerfReq;
-import org.onap.so.beans.nsmf.PerfReqEmbbList;
+import org.onap.so.beans.nsmf.PerfReqEmbb;
import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
@@ -289,7 +289,7 @@ public class NssmfAdapterRestTest {
assertEquals(all.getAllocateCnNssi().getSliceProfile().getResourceSharingLevel(), NON_SHARED);
assertNotNull(all.getAllocateCnNssi().getSliceProfile().getPerfReq());
assertNotNull(all.getAllocateCnNssi().getSliceProfile().getPerfReq().getPerfReqEmbbList());
- PerfReqEmbbList embb =
+ PerfReqEmbb embb =
all.getAllocateCnNssi().getSliceProfile().getPerfReq().getPerfReqEmbbList().iterator().next();
assertNotNull(embb);
assertEquals(embb.getActivityFactor(), 50);
@@ -302,9 +302,9 @@ public class NssmfAdapterRestTest {
List<String> plmn = new LinkedList<>();
plmn.add("460-00");
plmn.add("460-01");
- PerfReqEmbbList embb = new PerfReqEmbbList();
+ PerfReqEmbb embb = new PerfReqEmbb();
embb.setActivityFactor(50);
- List<PerfReqEmbbList> embbList = new LinkedList<>();
+ List<PerfReqEmbb> embbList = new LinkedList<>();
embbList.add(embb);
PerfReq perfReq = new PerfReq();
perfReq.setPerfReqEmbbList(embbList);
diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java
index 3108ade5a6..4a659e1ca3 100644
--- a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java
+++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java
@@ -191,9 +191,9 @@ public class NssmfManagerServiceImplTest {
List<String> plmn = new LinkedList<>();
plmn.add("460-00");
plmn.add("460-01");
- PerfReqEmbbList embb = new PerfReqEmbbList();
+ PerfReqEmbb embb = new PerfReqEmbb();
embb.setActivityFactor(50);
- List<PerfReqEmbbList> embbList = new LinkedList<>();
+ List<PerfReqEmbb> embbList = new LinkedList<>();
embbList.add(embb);
PerfReq perfReq = new PerfReq();
perfReq.setPerfReqEmbbList(embbList);