diff options
author | MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com> | 2022-05-06 16:17:27 +0530 |
---|---|---|
committer | MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com> | 2022-05-06 16:17:27 +0530 |
commit | c0e81367ca4b30a1ce92aeeaaf62ecb9c8ec7a29 (patch) | |
tree | 878c8c6d9cfc6a4c6278d354573bd9b9416bdf61 /so-nssmf-adapter-application/src/test/java | |
parent | b34630f4e4a008379c7a342fd994011d9d5d73bf (diff) |
Issue-ID: SO-3707
Signed-off-by: MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Change-Id: If5ca92abc74d5d46a8e4269d4962edb6b9a940e8
Diffstat (limited to 'so-nssmf-adapter-application/src/test/java')
-rw-r--r-- | so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java index df49953..76d2a05 100644 --- a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java +++ b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java @@ -520,6 +520,67 @@ public class NssmfManagerServiceImplTest { }
@Test
+ public void modifyAnNssi() throws Exception {
+ modifyNssi(ACCESS);
+ }
+
+
+ @Test
+ public void modifyCnNssi() throws Exception {
+ modifyNssi(CORE);
+ }
+
+ public void modifyNssi(NetworkType domainType) throws Exception {
+ NssmfInfo nssmf = new NssmfInfo();
+ nssmf.setUserName("nssmf-user");
+ nssmf.setPassword("nssmf-pass");
+ nssmf.setPort("8080");
+ nssmf.setIpAddress("127.0.0.1");
+ nssmf.setUrl("http://127.0.0.1:8080");
+
+ NssiResponse nssiRes = new NssiResponse();
+ nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+ nssiRes.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ TokenResponse token = new TokenResponse();
+ token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ token.setExpires(1800);
+
+ postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest(domainType);
+
+ ServiceInfo serviceInfo = new ServiceInfo();
+ serviceInfo.setServiceUuid("8ee5926d-720b-4bb2-86f9-d20e921c143b");
+ serviceInfo.setServiceInvariantUuid("e75698d9-925a-4cdd-a6c0-edacbe6a0b51");
+ serviceInfo.setGlobalSubscriberId("5GCustomer");
+ serviceInfo.setServiceType("5G");
+ serviceInfo.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ serviceInfo.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ AllocateCnNssi cnNssi = new AllocateCnNssi();
+ cnNssi.setNssiId("NSST-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ AllocateAnNssi anNssi = new AllocateAnNssi();
+ anNssi.setNssiId("NSST-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ nbiRequest.setServiceInfo(serviceInfo);
+ nbiRequest.setAllocateCnNssi(cnNssi);
+ nbiRequest.setAllocateAnNssi(anNssi);
+
+ createCommonMock(200, nssmf);
+ ResponseEntity res = nssiManagerService.allocateNssi(nbiRequest);
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ if (!domainType.equals(ACCESS)) {
+ assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ }
+ assertNotNull(allRes);
+ }
+
+ @Test
public void testNssmfRequest() throws ApplicationException {
NssmfRequest nssmfRequest = new NssmfRequest();
String sst = marshal(nssmfRequest);
|