use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup in project so by onap.
the class AAIObjectInstanceNameGeneratorTest method generateInstanceGroupNameTest.
@Test
public void generateInstanceGroupNameTest() throws Exception {
ModelInfoInstanceGroup modelVnfc = new ModelInfoInstanceGroup();
modelVnfc.setFunction("vre");
modelVnfc.setType("VNFC");
InstanceGroup instanceGroup = new InstanceGroup();
instanceGroup.setId("test-001");
instanceGroup.setModelInfoInstanceGroup(modelVnfc);
GenericVnf vnf = new GenericVnf();
vnf.setVnfId("vnf-123");
vnf.setVnfName("test-vnf");
assertEquals("test-vnf_vre", new AAIObjectInstanceNameGenerator().generateInstanceGroupName(instanceGroup, vnf));
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup in project so by onap.
the class BBInputSetupTest method testMapCatalogCollectionAndInstanceGroup.
@Test
public void testMapCatalogCollectionAndInstanceGroup() {
ModelInfoCollection modelInfoCollection = new ModelInfoCollection();
modelInfoCollection.setCollectionFunction("collectionFunction");
modelInfoCollection.setCollectionRole("collectionRole");
modelInfoCollection.setCollectionType("collectionType");
modelInfoCollection.setDescription("description");
modelInfoCollection.setModelInvariantUUID("modelInvariantUUID");
modelInfoCollection.setQuantity(0);
ModelInfoInstanceGroup modelInfoInstanceGroup = new ModelInfoInstanceGroup();
modelInfoInstanceGroup.setFunction("function");
modelInfoInstanceGroup.setInstanceGroupRole("instanceGroupRole");
modelInfoInstanceGroup.setModelInvariantUUID("modelInvariantUUID");
modelInfoInstanceGroup.setModelUUID("modelUUID");
modelInfoInstanceGroup.setType("VNFC");
modelInfoInstanceGroup.setDescription("description");
InstanceGroup instanceGroup = new InstanceGroup();
Collection collection = new Collection();
collection.setInstanceGroup(instanceGroup);
CollectionResource collectionResource = new CollectionResource();
org.onap.so.db.catalog.beans.InstanceGroup catalogInstanceGroup = new org.onap.so.db.catalog.beans.InstanceGroup();
collectionResource.setToscaNodeType("NetworkCollection");
collectionResource.setInstanceGroup(catalogInstanceGroup);
CollectionResourceCustomization collectionCust = new NetworkCollectionResourceCustomization();
collectionCust.setModelCustomizationUUID("modelCustomizationUUID");
collectionCust.setCollectionResource(collectionResource);
Service service = new Service();
service.getCollectionResourceCustomizations().add(collectionCust);
ServiceInstance serviceInstance = new ServiceInstance();
serviceInstance.setCollection(collection);
List<CollectionResourceInstanceGroupCustomization> instanceGroupCustList = new ArrayList<>();
CollectionResourceInstanceGroupCustomization instanceGroupCust = new CollectionResourceInstanceGroupCustomization();
instanceGroupCust.setFunction("function");
instanceGroupCust.setDescription("description");
doReturn(modelInfoCollection).when(bbInputSetupMapperLayer).mapCatalogCollectionToCollection(collectionCust, collectionResource);
doReturn(modelInfoInstanceGroup).when(bbInputSetupMapperLayer).mapCatalogInstanceGroupToInstanceGroup(collectionCust, catalogInstanceGroup);
SPY_bbInputSetup.mapCatalogCollection(service, serviceInstance.getCollection(), "modelCustomizationUUID");
SPY_bbInputSetup.mapCatalogNetworkCollectionInstanceGroup(service, serviceInstance.getCollection().getInstanceGroup(), collectionCust.getModelCustomizationUUID());
assertThat(collection.getModelInfoCollection(), sameBeanAs(modelInfoCollection));
assertThat(instanceGroup.getModelInfoInstanceGroup(), sameBeanAs(modelInfoInstanceGroup));
}
Aggregations