diff options
author | Benjamin, Max <max.benjamin@att.com> | 2020-09-21 11:38:23 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-09-23 16:32:42 -0400 |
commit | 2505a543b0e45c1c3c2fe2fb8b85664b08bf2fca (patch) | |
tree | 5f1593d45f8c9a2fb2d400b8fa58dbb3e29ef671 /bpmn/MSOCommonBPMN/src/test/java/org/onap | |
parent | 8d68a316f303d0fc57eb7da4fef881a26d39d439 (diff) |
removed references to AAIObjectType
removed references to AAIObjectType and AAIObjectPlurals
additional corrections for removal of aai object type
corrected additional java files
updated groovy files to match aai fluent builder style
Issue-ID: SO-3259
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: Ifdf12fcacb34cc648548eb18b638afd06dad67a9
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/onap')
4 files changed, 63 insertions, 50 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index 70bce65f5b..127253a72e 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -59,7 +59,6 @@ import org.mockito.Mockito; import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; -import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; @@ -69,12 +68,12 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection; import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; -import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness; import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity; import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.Project; import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; @@ -1830,7 +1829,8 @@ public class BBInputSetupTest { expectedAAI.setRelationshipList(relationshipList); Configuration expected = new Configuration(); - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, "configurationId"); + AAIResourceUri aaiResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().configuration("configurationId")); AAIResultWrapper configurationWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); @@ -1854,7 +1854,8 @@ public class BBInputSetupTest { expectedAAI.setRelationshipList(relationshipList); GenericVnf expected = new GenericVnf(); - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "vnfId"); + AAIResourceUri aaiResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId")); AAIResultWrapper vnfWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); @@ -1884,7 +1885,7 @@ public class BBInputSetupTest { expectedAAI.setRelationshipList(relationshipList); Pnf expected = new Pnf(); - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.PNF, "pnfId"); + AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().pnf("pnfId")); AAIResultWrapper pnfWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); @@ -2008,7 +2009,8 @@ public class BBInputSetupTest { List<L3Network> l3Networks = new ArrayList<>(); AAIResultWrapper l3NetworksWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, "networkId"); + AAIResourceUri aaiResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Network("networkId")); doReturn(l3NetworksWrapper).when(SPY_bbInputSetupUtils).getAAIResourceDepthTwo(aaiResourceUri); doReturn(expected).when(bbInputSetupMapperLayer).mapAAIL3Network(isA(org.onap.aai.domain.yang.L3Network.class)); @@ -3422,7 +3424,7 @@ public class BBInputSetupTest { String vnfcName = "vnfcName"; org.onap.aai.domain.yang.Configuration expectedAAI = new org.onap.aai.domain.yang.Configuration(); - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, vnfcName); + AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc(vnfcName)); AAIResultWrapper configurationWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java index f6615e52c8..c65b36a40c 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java @@ -64,12 +64,12 @@ import org.onap.aai.domain.yang.ServiceInstances; import org.onap.aai.domain.yang.VolumeGroup; import org.onap.aai.domain.yang.VolumeGroups; import org.onap.aai.domain.yang.VpnBinding; -import org.onap.aaiclient.client.aai.AAIObjectPlurals; -import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.aai.AAIResourcesClient; import org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri; 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.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; import org.onap.aaiclient.client.graphinventory.entities.uri.Depth; import org.onap.so.bpmn.common.InjectionHelper; import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer; @@ -179,8 +179,10 @@ public class BBInputSetupUtilsTest { Optional<CloudRegion> expected = Optional.of(new CloudRegion()); doReturn(expected).when(MOCK_aaiResourcesClient).get(CloudRegion.class, - AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudConfig.getCloudOwner(), - cloudConfig.getLcpCloudRegionId()).depth(Depth.TWO)); + AAIUriFactory + .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure() + .cloudRegion(cloudConfig.getCloudOwner(), cloudConfig.getLcpCloudRegionId())) + .depth(Depth.TWO)); assertThat(bbInputSetupUtils.getCloudRegion(cloudConfig), sameBeanAs(expected.get())); } @@ -208,7 +210,7 @@ public class BBInputSetupUtilsTest { expected.get().setId(instanceGroupId); doReturn(expected).when(MOCK_aaiResourcesClient).get(InstanceGroup.class, - AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroupId)); + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().instanceGroup(instanceGroupId))); assertThat(bbInputSetupUtils.getAAIInstanceGroup(instanceGroupId), sameBeanAs(expected.get())); } @@ -225,7 +227,7 @@ public class BBInputSetupUtilsTest { expected.get().setGlobalCustomerId(globalSubscriberId); doReturn(expected).when(MOCK_aaiResourcesClient).get(org.onap.aai.domain.yang.Customer.class, - AAIUriFactory.createResourceUri(AAIObjectType.CUSTOMER, globalSubscriberId)); + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(globalSubscriberId))); assertThat(bbInputSetupUtils.getAAICustomer(globalSubscriberId), sameBeanAs(expected.get())); } @@ -244,8 +246,8 @@ public class BBInputSetupUtilsTest { expected.get().setServiceType(subscriptionServiceType); doReturn(expected).when(MOCK_aaiResourcesClient).get(org.onap.aai.domain.yang.ServiceSubscription.class, - AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_SUBSCRIPTION, globalSubscriberId, - subscriptionServiceType)); + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType))); assertThat(bbInputSetupUtils.getAAIServiceSubscription(globalSubscriberId, subscriptionServiceType), sameBeanAs(expected.get())); @@ -286,9 +288,12 @@ public class BBInputSetupUtilsTest { ServiceInstance expected = new ServiceInstance(); expected.setServiceInstanceId(serviceInstanceId); - doReturn(Optional.of(expected)).when(MOCK_aaiResourcesClient).get(ServiceInstance.class, AAIUriFactory - .createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId, serviceType, serviceInstanceId) - .depth(Depth.TWO)); + doReturn(Optional.of(expected)).when(MOCK_aaiResourcesClient) + .get(ServiceInstance.class, + AAIUriFactory + .createResourceUri(AAIFluentTypeBuilder.business().customer(globalCustomerId) + .serviceSubscription(serviceType).serviceInstance(serviceInstanceId)) + .depth(Depth.TWO)); assertThat(bbInputSetupUtils.getAAIServiceInstanceByIdAndCustomer(globalCustomerId, serviceType, serviceInstanceId), sameBeanAs(expected)); @@ -320,8 +325,8 @@ public class BBInputSetupUtilsTest { serviceInstances.getServiceInstance().add(expectedServiceInstance); AAIPluralResourceUri expectedUri = AAIUriFactory - .createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer.getGlobalCustomerId(), - customer.getServiceSubscription().getServiceType()) + .createResourceUri(AAIFluentTypeBuilder.business().customer(customer.getGlobalCustomerId()) + .serviceSubscription(customer.getServiceSubscription().getServiceType()).serviceInstances()) .queryParam("service-instance-name", serviceInstanceName).depth(Depth.TWO); bbInputSetupUtils.getAAIServiceInstanceByName(serviceInstanceName, customer); @@ -402,14 +407,15 @@ public class BBInputSetupUtilsTest { mapper.readValue(new File(RESOURCE_PATH + "aaiGenericVnfInput.json"), GenericVnf.class); doReturn(Optional.of(expectedAaiVnf)).when(MOCK_aaiResourcesClient).get(isA(Class.class), - eq(AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).depth(Depth.ONE))); + eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId)).depth(Depth.ONE))); assertThat(bbInputSetupUtils.getAAIGenericVnf(vnfId), sameBeanAs(expectedAaiVnf)); } @Test public void getAAIResourceDepthOneTest() { - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "anyVnfId"); + AAIResourceUri aaiResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("anyVnfId")); AAIResourceUri expectedUri = aaiResourceUri.clone().depth(Depth.ONE); AAIResourceUri aaiResourceUriClone = aaiResourceUri.clone(); @@ -421,7 +427,8 @@ public class BBInputSetupUtilsTest { @Test public void getAAIResourceDepthTwoTest() { - AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "anyVnfId"); + AAIResourceUri aaiResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("anyVnfId")); AAIResourceUri expectedUri = aaiResourceUri.clone().depth(Depth.TWO); AAIResourceUri aaiResourceUriClone = aaiResourceUri.clone(); @@ -516,8 +523,8 @@ public class BBInputSetupUtilsTest { vnf.setVnfId(vnfId); vnf.setVnfName(vnfName); doReturn(Optional.of(vnf)).when(MOCK_aaiResourcesClient).getOne(GenericVnfs.class, GenericVnf.class, - AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) - .relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName)); + AAIUriFactory.createResourceUri(Types.SERVICE_INSTANCE.getFragment(serviceInstanceId)) + .relatedTo(Types.GENERIC_VNFS.getFragment()).queryParam("vnf-name", vnfName)); Optional<GenericVnf> actual = this.bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(serviceInstanceId, vnfName); assertTrue(actual.isPresent()); @@ -545,8 +552,8 @@ public class BBInputSetupUtilsTest { volumeGroup.setVolumeGroupId(volumeGroupId); volumeGroup.setVolumeGroupName(volumeGroupName); doReturn(Optional.of(volumeGroup)).when(MOCK_aaiResourcesClient).getOne(VolumeGroups.class, VolumeGroup.class, - AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) - .relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName)); + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId)) + .relatedTo(Types.VOLUME_GROUPS.getFragment()).queryParam("volume-group-name", volumeGroupName)); Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(vnfId, volumeGroupName); assertEquals(volumeGroup.getVolumeGroupId(), actual.get().getVolumeGroupId()); @@ -572,8 +579,10 @@ public class BBInputSetupUtilsTest { volumeGroup.setVolumeGroupId("id123"); volumeGroup.setVolumeGroupName("name123"); doReturn(Optional.of(volumeGroup)).when(MOCK_aaiResourcesClient).getOne(VolumeGroups.class, VolumeGroup.class, - AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, "vnf-id123", "vf-module-id123") - .relatedTo(AAIObjectPlurals.VOLUME_GROUP) + AAIUriFactory + .createResourceUri( + AAIFluentTypeBuilder.network().genericVnf("vnf-id123").vfModule("vf-module-id123")) + .relatedTo(Types.VOLUME_GROUPS.getFragment()) .queryParam("volume-group-name", "volume-group-name123")); Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule("vnf-id123", "vf-module-id123", "volume-group-name123"); @@ -620,8 +629,10 @@ public class BBInputSetupUtilsTest { VolumeGroup volumeGroup = new VolumeGroup(); volumeGroup.setVolumeGroupId("id123"); doReturn(Optional.of(volumeGroup)).when(MOCK_aaiResourcesClient).getOne(VolumeGroups.class, VolumeGroup.class, - AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, "vnf-id123", "vf-module-id123") - .relatedTo(AAIObjectPlurals.VOLUME_GROUP)); + AAIUriFactory + .createResourceUri( + AAIFluentTypeBuilder.network().genericVnf("vnf-id123").vfModule("vf-module-id123")) + .relatedTo(Types.VOLUME_GROUPS.getFragment())); Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupFromVfModule("vnf-id123", "vf-module-id123"); assertTrue(actual.isPresent()); @@ -679,8 +690,8 @@ public class BBInputSetupUtilsTest { configuration.setConfigurationId("id123"); doReturn(Optional.of(configuration)).when(MOCK_aaiResourcesClient).getOne(Configurations.class, Configuration.class, - AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "service-instance-id123") - .relatedTo(AAIObjectPlurals.CONFIGURATION) + AAIUriFactory.createResourceUri(Types.SERVICE_INSTANCE.getFragment("service-instance-id123")) + .relatedTo(Types.CONFIGURATIONS.getFragment()) .queryParam("configuration-name", "configuration-name123")); Optional<Configuration> actual = this.bbInputSetupUtils .getRelatedConfigurationByNameFromServiceInstance("service-instance-id123", "configuration-name123"); @@ -690,8 +701,8 @@ public class BBInputSetupUtilsTest { @Test public void existsAAIVfModuleGloballyByNameTest() { - AAIPluralResourceUri expectedUri = - AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE).queryParam("vf-module-name", "testVfModule"); + AAIPluralResourceUri expectedUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()) + .queryParam("vf-module-name", "testVfModule"); bbInputSetupUtils.existsAAIVfModuleGloballyByName("testVfModule"); verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri); @@ -699,8 +710,9 @@ public class BBInputSetupUtilsTest { @Test public void existsAAIConfigurationGloballyByNameTest() { - AAIPluralResourceUri expectedUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION) - .queryParam("configuration-name", "testConfig"); + AAIPluralResourceUri expectedUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().configurations()) + .queryParam("configuration-name", "testConfig"); bbInputSetupUtils.existsAAIConfigurationGloballyByName("testConfig"); verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri); @@ -708,8 +720,8 @@ public class BBInputSetupUtilsTest { @Test public void existsAAINetworksGloballyByNameTest() { - AAIPluralResourceUri expectedUri = - AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", "testNetwork"); + AAIPluralResourceUri expectedUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Networks()) + .queryParam("network-name", "testNetwork"); bbInputSetupUtils.existsAAINetworksGloballyByName("testNetwork"); verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri); @@ -717,7 +729,7 @@ public class BBInputSetupUtilsTest { @Test public void existsAAIVolumeGroupGloballyByNameTest() { - AAIPluralResourceUri expectedUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP) + AAIPluralResourceUri expectedUri = AAIUriFactory.createNodesUri(Types.VOLUME_GROUPS.getFragment()) .queryParam("volume-group-name", "testVoumeGroup"); bbInputSetupUtils.existsAAIVolumeGroupGloballyByName("testVoumeGroup"); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java index edd214f85f..4d034a19e8 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java @@ -23,7 +23,6 @@ package org.onap.so.bpmn.servicedecomposition.tasks; import static com.shazam.shazamcrest.MatcherAssert.assertThat; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doReturn; import java.io.File; @@ -38,14 +37,14 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; +import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; +import org.onap.aaiclient.client.aai.entities.Relationships; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; -import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; -import org.onap.aaiclient.client.aai.AAIObjectType; -import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; -import org.onap.aaiclient.client.aai.entities.Relationships; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; @@ -143,14 +142,14 @@ public class CloudInfoFromAAITest { new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(cloudRegion)); cloudRegions.add(cloudRegionWrapper); - doReturn(cloudRegions).when(relationships).getByType(AAIObjectType.CLOUD_REGION); + doReturn(cloudRegions).when(relationships).getByType(Types.CLOUD_REGION); List<AAIResultWrapper> tenants = new ArrayList<>(); org.onap.aai.domain.yang.Tenant tenant = new org.onap.aai.domain.yang.Tenant(); tenant.setTenantId(tenantId); AAIResultWrapper tenantWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(tenant)); tenants.add(tenantWrapper); - doReturn(tenants).when(relationships).getByType(AAIObjectType.TENANT); + doReturn(tenants).when(relationships).getByType(Types.TENANT); Optional<CloudRegion> actual = SPY_CloudInfoFromAAI.getRelatedCloudRegionAndTenant(relationships); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java index e05a3bda8f..fff495f9a8 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java @@ -34,14 +34,14 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; import org.onap.aai.domain.yang.Vserver; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; +import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider; import org.onap.so.BaseTest; import org.onap.so.bpmn.common.DelegateExecutionImpl; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.mock.FileUtil; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; -import org.onap.aaiclient.client.aai.AAIObjectType; -import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider; import org.onap.so.objects.audit.AAIObjectAudit; import org.onap.so.objects.audit.AAIObjectAuditList; import org.springframework.beans.BeanUtils; @@ -71,7 +71,7 @@ public class ExceptionBuilderTest extends BaseTest { auditList.setAuditType("create"); auditList.setHeatStackName("testStackName"); AAIObjectAudit vserver = new AAIObjectAudit(); - vserver.setAaiObjectType(AAIObjectType.VSERVER.typeName()); + vserver.setAaiObjectType(Types.VSERVER.typeName()); vserver.setDoesObjectExist(false); Vserver vs = new Vserver(); vs.setVserverId("testVServerId"); |