diff options
Diffstat (limited to 'adapters/mso-nssmf-adapter/src')
2 files changed, 20 insertions, 17 deletions
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java index 3f2e5b23f2..442339d9fe 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java @@ -24,9 +24,9 @@ package org.onap.so.adapters.nssmf.extclients.aai; import org.onap.aai.domain.yang.EsrSystemInfoList; import org.onap.aai.domain.yang.EsrThirdpartySdncList; import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -47,7 +47,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public EsrThirdpartySdncList invokeGetThirdPartySdncList() { return aaiClientProvider.getAaiClient() - .get(EsrThirdpartySdncList.class, AAIUriFactory.createResourceUri(AAIObjectType.THIRDPARTY_SDNC_LIST)) + .get(EsrThirdpartySdncList.class, + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.externalSystem().esrThirdpartySdncList())) .orElseGet(() -> { logger.debug("No VNFMs in AAI"); return null; @@ -58,7 +59,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { public EsrSystemInfoList invokeGetThirdPartySdncEsrSystemInfo(String sdncId) { return aaiClientProvider.getAaiClient() .get(EsrSystemInfoList.class, - AAIUriFactory.createResourceUri(AAIObjectType.THIRDPARTY_SDNC_SYSTEM_INFO_LIST, sdncId)) + AAIUriFactory + .createResourceUri(AAIFluentTypeBuilder.externalSystem().esrThirdpartySdnc((sdncId)))) .orElseGet(() -> { logger.debug("VNFM not found in AAI"); return null; @@ -69,8 +71,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public void invokeCreateServiceInstance(ServiceInstance nssiInstance, String globalSubscriberId, String serviceType, String serviceInstanceId) { - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, - serviceType, serviceInstanceId); + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId).serviceSubscription(serviceType).serviceInstance(serviceInstanceId)); aaiClientProvider.getAaiClient().create(uri, nssiInstance); } } 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 67cd913b3e..f150f47f4f 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 @@ -20,6 +20,17 @@ package org.onap.so.adapters.nssmf; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; +import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal; +import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal; +import static org.onap.so.beans.nsmf.NetworkType.CORE; +import static org.onap.so.beans.nsmf.ResourceSharingLevel.NON_SHARED; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.LinkedList; @@ -56,19 +67,9 @@ import org.onap.so.beans.nsmf.NssiResponse; import org.onap.so.beans.nsmf.PerfReq; import org.onap.so.beans.nsmf.PerfReqEmbb; import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository; +import org.skyscreamer.jsonassert.JSONAssert; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.when; -import static org.mockito.MockitoAnnotations.initMocks; -import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal; -import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal; -import static org.onap.so.beans.nsmf.NetworkType.CORE; -import static org.onap.so.beans.nsmf.ResourceSharingLevel.NON_SHARED; @RunWith(SpringRunner.class) public class NssmfAdapterRestTest { @@ -281,7 +282,7 @@ public class NssmfAdapterRestTest { // @Test public void testAllocateJsonSerDeSer() throws Exception { - assertEquals(marshal(allocateNssi()), ALLOCATE); + JSONAssert.assertEquals(marshal(allocateNssi()), ALLOCATE, false); NssiAllocateRequest all = unMarshal(ALLOCATE, NssiAllocateRequest.class); assertNotNull(all); assertNotNull(all.getAllocateCnNssi()); |