aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorEnbo Wang <wangenbo@huawei.com>2020-08-30 22:12:53 +0800
committerEnbo Wang <wangenbo@huawei.com>2020-08-30 22:12:53 +0800
commit4d43829503cbd767b50a25549feab45947b6b7f5 (patch)
tree0eb7ea14b49e476157be256c0b317e4b7051e7d0 /adapters
parentc8ad6ec7db819a9e4b64b31f2fc40cc683a5bc99 (diff)
Update NSSMF adapter to support External RAN NSSMF
Issue-ID: SO-3202 Signed-off-by: Enbo Wang <wangenbo@huawei.com> Change-Id: I65b8143ad38017117ffb0677054bad3f76ae90e4
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);