diff options
10 files changed, 220 insertions, 9 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java index 2a5a739075..aeee279002 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java @@ -25,14 +25,25 @@ import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.so.adapters.catalogdb.CatalogDBApplication; +import org.onap.so.db.catalog.beans.ConfigurationResource; import org.onap.so.db.catalog.beans.CvnfcCustomization; +import org.onap.so.db.catalog.beans.VfModule; +import org.onap.so.db.catalog.beans.VfModuleCustomization; +import org.onap.so.db.catalog.beans.VnfResource; +import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; +import org.onap.so.db.catalog.beans.VnfcCustomization; import org.onap.so.db.catalog.client.CatalogDbClientPortChanger; +import org.onap.so.db.catalog.data.repository.CvnfcCustomizationRepository; import org.onap.so.logger.MsoLogger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.server.LocalServerPort; @@ -47,6 +58,9 @@ import org.springframework.beans.BeanUtils; @ActiveProfiles("test") public class CvnfcCatalogDbQueryTest { + @Autowired + private CvnfcCustomizationRepository cvnfcCustomizationRepository; + private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CvnfcCatalogDbQueryTest.class); @LocalServerPort @@ -64,7 +78,7 @@ public class CvnfcCatalogDbQueryTest { @Test public void cVnfcTest() { - CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization(); + CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization("dadc2c8c-2bab-11e9-b210-d663bd873d93"); List<CvnfcCustomization> foundCvnfcCustomization = client.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671","cb82ffd8-252a-11e7-93ae-92361f002671"); assertNotNull(foundCvnfcCustomization); @@ -81,9 +95,83 @@ public class CvnfcCatalogDbQueryTest { .ignoring("vnfResourceCusteModelCustomizationUUID")); } - protected CvnfcCustomization setUpCvnfcCustomization(){ + @Test + public void getLinkedVnfVfmoduleCvnfcConfigurationCustomizationTest() { + + CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization("0c042562-2bac-11e9-b210-d663bd873d93"); + + VnfcCustomization vnfcCustomization = setUpVnfcCustomization(); + vnfcCustomization.setModelCustomizationUUID("d95d704a-9ff2-11e8-98d0-529269fb1459"); + cvnfcCustomization.setVnfcCustomization(vnfcCustomization); + + ConfigurationResource configurationResource = new ConfigurationResource(); + configurationResource.setToscaNodeType("FabricConfiguration"); + configurationResource.setModelInvariantUUID("modelInvariantUUID"); + configurationResource.setModelUUID("modelUUID"); + configurationResource.setModelName("modelName"); + configurationResource.setModelVersion("modelVersion"); + configurationResource.setDescription("description"); + configurationResource.setToscaNodeType("toscaNodeTypeFC"); + + VnfResource vnfResource = new VnfResource(); + vnfResource.setModelUUID("6f19c5fa-2b19-11e9-b210-d663bd873d93"); + vnfResource.setModelVersion("modelVersion"); + vnfResource.setOrchestrationMode("orchestrationMode"); + + VfModule vfModule = new VfModule(); + vfModule.setModelUUID("98aa2a6e-2b18-11e9-b210-d663bd873d93"); + vfModule.setModelInvariantUUID("9fe57860-2b18-11e9-b210-d663bd873d93"); + vfModule.setIsBase(true); + vfModule.setModelName("modelName"); + vfModule.setModelVersion("modelVersion"); + vfModule.setVnfResources(vnfResource); + + VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); + vfModuleCustomization.setModelCustomizationUUID("bdbf984a-2b16-11e9-b210-d663bd873d93"); + vfModuleCustomization.setVfModule(vfModule); + cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization); + + VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization(); + vnfResourceCustomization.setModelCustomizationUUID("6912dd02-2b16-11e9-b210-d663bd873d93"); + vnfResourceCustomization.setModelInstanceName("testModelInstanceName"); + vnfResourceCustomization.setVnfResources(vnfResource); + cvnfcCustomization.setVnfResourceCustomization(vnfResourceCustomization); + + VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = new VnfVfmoduleCvnfcConfigurationCustomization(); + vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationFunction("configurationFunction"); + vnfVfmoduleCvnfcConfigurationCustomization.setModelCustomizationUUID("64627fec-2b1b-11e9-b210-d663bd873d93"); + vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource); + vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization); + vnfVfmoduleCvnfcConfigurationCustomization.setModelInstanceName("modelInstanceName"); + vnfVfmoduleCvnfcConfigurationCustomization.setVfModuleCustomization(vfModuleCustomization); + vnfVfmoduleCvnfcConfigurationCustomization.setVnfResourceCustomization(vnfResourceCustomization); + + Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationSet = new HashSet<VnfVfmoduleCvnfcConfigurationCustomization>(); + vnfVfmoduleCvnfcConfigurationCustomizationSet.add(vnfVfmoduleCvnfcConfigurationCustomization); + cvnfcCustomization.setVnfVfmoduleCvnfcConfigurationCustomization(vnfVfmoduleCvnfcConfigurationCustomizationSet); + + vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization); + + cvnfcCustomizationRepository.save(cvnfcCustomization); + + List<CvnfcCustomization> foundCvnfcCustomization = client.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("6912dd02-2b16-11e9-b210-d663bd873d93","bdbf984a-2b16-11e9-b210-d663bd873d93"); + assertNotNull(foundCvnfcCustomization); + assertTrue(foundCvnfcCustomization.size() > 0); + CvnfcCustomization found = foundCvnfcCustomization.get(0); + + Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizations = found.getVnfVfmoduleCvnfcConfigurationCustomization(); + if (vnfVfmoduleCvnfcConfigurationCustomizations.size() > 0){ + for(VnfVfmoduleCvnfcConfigurationCustomization customization : vnfVfmoduleCvnfcConfigurationCustomizations) { + Assert.assertTrue(customization.getConfigurationResource().getToscaNodeType().equalsIgnoreCase("toscaNodeTypeFC")); + } + } else { + Assert.fail("No linked VnfVfmoduleCvnfcConfigurationCustomization found for CvnfcCustomization"); + } + } + + protected CvnfcCustomization setUpCvnfcCustomization(String id){ CvnfcCustomization cvnfcCustomization = new CvnfcCustomization(); - cvnfcCustomization.setModelCustomizationUUID("9bcce658-9b37-11e8-98d0-529269fb1459"); + cvnfcCustomization.setModelCustomizationUUID(id); cvnfcCustomization.setModelInstanceName("testModelInstanceName"); cvnfcCustomization.setModelUUID("b25735fe-9b37-11e8-98d0-529269fb1459"); cvnfcCustomization.setModelInvariantUUID("ba7e6ef0-9b37-11e8-98d0-529269fb1459"); @@ -95,4 +183,16 @@ public class CvnfcCatalogDbQueryTest { cvnfcCustomization.setNfcNamingCode("testNfcNamingCode"); return cvnfcCustomization; } + + protected VnfcCustomization setUpVnfcCustomization(){ + VnfcCustomization vnfcCustomization = new VnfcCustomization(); + vnfcCustomization.setModelInstanceName("testVnfcCustomizationModelInstanceName"); + vnfcCustomization.setModelUUID("321228a4-9f15-11e8-98d0-529269fb1459"); + vnfcCustomization.setModelInvariantUUID("c0659136-9f15-11e8-98d0-529269fb1459"); + vnfcCustomization.setModelVersion("testModelVersion"); + vnfcCustomization.setModelName("testModelName"); + vnfcCustomization.setToscaNodeType("testToscaModelType"); + vnfcCustomization.setDescription("testVnfcCustomizationDescription"); + return vnfcCustomization; + } } diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 75015e589d..1223080e59 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -279,7 +279,7 @@ INSERT INTO `cvnfc_customization` `vf_module_cust_model_customization_uuid`, `vnfc_cust_model_customization_uuid`) VALUES ( '1', - '9bcce658-9b37-11e8-98d0-529269fb1459', + 'dadc2c8c-2bab-11e9-b210-d663bd873d93', 'testModelInstanceName', 'b25735fe-9b37-11e8-98d0-529269fb1459', 'ba7e6ef0-9b37-11e8-98d0-529269fb1459', diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java index 7bba136da2..974315374a 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java @@ -162,7 +162,8 @@ public class HeatStackAudit { auditVserver.setLInterfaces(new LInterfaces()); auditVserver.setVserverId(novaResource.getPhysicalResourceId()); Stream<Resource> filteredNeutronNetworks = resources.getList().stream() - .filter(network -> network.getRequiredBy().contains(novaResource.getLogicalResourceId())); + .filter(resource -> resource.getRequiredBy().contains(novaResource.getLogicalResourceId())) + .filter(resource -> "OS::Neutron::Port".equals(resource.getType())); filteredNeutronNetworks.forEach(network -> { LInterface lInterface = new LInterface(); lInterface.setInterfaceId(network.getPhysicalResourceId()); diff --git a/adapters/mso-openstack-adapters/src/test/resources/GetResources.json b/adapters/mso-openstack-adapters/src/test/resources/GetResources.json index 6e2bad38a4..22e66d41bb 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/GetResources.json +++ b/adapters/mso-openstack-adapters/src/test/resources/GetResources.json @@ -1,5 +1,27 @@ { "resources": [ + { + "links": [ + { + "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732/resources/vlbagent_eph_aff_id", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732", + "rel": "stack" + } + ], + "logical_resource_id": "vlbagent_eph_aff_id", + "physical_resource_id": "zdyh3brlba05_addon-vlbagent_eph_aff_id-euhxoicxsgso", + "required_by": [ + "ssc_server_1" + ], + "resource_name": "vlbagent_eph_aff_id", + "resource_status": "CREATE_COMPLETE", + "resource_status_reason": "state changed", + "resource_type": "OS::Heat::RandomString", + "updated_time": "2019-02-07T22:56:12Z" + }, { "resource_name": "ssc_1_trusted_port_0", "links": [ @@ -203,4 +225,4 @@ "resource_type": "OS::Heat::ResourceGroup" } ] -}
\ No newline at end of file +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java index 95b86524a3..c50a6db178 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java @@ -75,7 +75,7 @@ public class DmaapPropertiesClientTest extends BaseTest{ @Test public void testDmaapPublishRequest() throws JsonProcessingException, MapperException { - stubFor(post(urlEqualTo("/events/com.att.mso.asyncStatusUpdate?timeout=20000")) + stubFor(post(urlEqualTo("/events/com.att.mso.asyncStatusUpdate?timeout=60000")) .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_ACCEPTED))); dmaapPropertiesClient.dmaapPublishRequest(requestId, clientSource, correlator, serviceInstanceId, startTime, finishTime, requestScope, diff --git a/common/src/main/resources/dmaap/default-consumer.properties b/common/src/main/resources/dmaap/default-consumer.properties index f19b64242d..3f492e1d33 100644 --- a/common/src/main/resources/dmaap/default-consumer.properties +++ b/common/src/main/resources/dmaap/default-consumer.properties @@ -16,6 +16,7 @@ maxBatchSize=100 maxAgeMs=250 group=MSO id=dev +timeout=60000 AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler AFT_DME2_REQ_TRACE_ON=true diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java index c02b1e3030..b1ad0de5ca 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java @@ -107,7 +107,7 @@ public class CvnfcCustomization implements Serializable { @JoinColumn(name = "VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID") private VnfResourceCustomization vnfResourceCustomization; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "modelCustomizationUUID") + @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization") private Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomization; @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java index 8ef797f8fa..f5e9b5f560 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java @@ -44,6 +44,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; +import uk.co.blackpepper.bowman.annotation.LinkedResource; + @Entity @Table(name = "vnf_vfmodule_cvnfc_configuration_customization") public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable { @@ -202,6 +204,7 @@ public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable this.created = created; } + @LinkedResource public ConfigurationResource getConfigurationResource() { return configurationResource; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java index a4281aea6c..059d0da498 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java @@ -29,7 +29,7 @@ import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "cvnfcCustomization", path = "cvnfcCustomization") -public interface CvnfcCustomizationRepository extends JpaRepository<CvnfcCustomization, String> { +public interface CvnfcCustomizationRepository extends JpaRepository<CvnfcCustomization, Integer> { CvnfcCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid); List<CvnfcCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java index 63bd99f730..8de5366ff3 100644 --- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java +++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java @@ -24,16 +24,20 @@ import static com.shazam.shazamcrest.MatcherAssert.assertThat; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.junit.Assert; import org.junit.Test; import org.onap.so.db.catalog.BaseTest; +import org.onap.so.db.catalog.beans.ConfigurationResource; import org.onap.so.db.catalog.beans.CvnfcCustomization; import org.onap.so.db.catalog.beans.VfModule; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfResource; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.VnfcCustomization; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @@ -251,4 +255,84 @@ public class CvnfcCustomizationRepositoryTest extends BaseTest { } Assert.assertTrue(matchFound); } + + @Test + @Transactional + public void createAndGetCvnfcCustomizationsExtractToscaModelTest() throws Exception { + + CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization(); + cvnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459"); + + VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); + vfModuleCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459"); + + VfModule vFModule = setUpVfModule(); + VnfResource vnfResource = setUpVnfResource(); + + vFModule.setVnfResources(vnfResource); + vfModuleCustomization.setVfModule(vFModule); + cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization); + + VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization(); + vnfResourceCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459"); + vnfResourceCustomization.setModelInstanceName("testModelInstanceName"); + + List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList(); + vnfResourceCustomizations.add(vnfResourceCustomization); + vnfResource.setVnfResourceCustomizations(vnfResourceCustomizations); + vnfResourceCustomization.setVnfResources(vnfResource); + + cvnfcCustomization.setVnfResourceCustomization(vnfResourceCustomization); + + VnfcCustomization vnfcCustomization = setUpVnfcCustomization(); + vnfcCustomization.setModelCustomizationUUID("d95d704a-9ff2-11e8-98d0-529269fb1459"); + cvnfcCustomization.setVnfcCustomization(vnfcCustomization); + + ConfigurationResource configurationResource = new ConfigurationResource(); + configurationResource.setToscaNodeType("FabricConfiguration"); + configurationResource.setModelInvariantUUID("modelInvariantUUID"); + configurationResource.setModelUUID("modelUUID"); + configurationResource.setModelName("modelName"); + configurationResource.setModelVersion("modelVersion"); + configurationResource.setDescription("description"); + configurationResource.setToscaNodeType("toscaNodeType"); + + VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = new VnfVfmoduleCvnfcConfigurationCustomization(); + vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationFunction("configurationFunction"); + vnfVfmoduleCvnfcConfigurationCustomization.setModelCustomizationUUID("modelCustomizationUUID"); + vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource); + vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization); + vnfVfmoduleCvnfcConfigurationCustomization.setModelInstanceName("modelInstanceName"); + vnfVfmoduleCvnfcConfigurationCustomization.setVfModuleCustomization(vfModuleCustomization); + vnfVfmoduleCvnfcConfigurationCustomization.setVnfResourceCustomization(vnfResourceCustomization); + + Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationSet = new HashSet<VnfVfmoduleCvnfcConfigurationCustomization>(); + vnfVfmoduleCvnfcConfigurationCustomizationSet.add(vnfVfmoduleCvnfcConfigurationCustomization); + cvnfcCustomization.setVnfVfmoduleCvnfcConfigurationCustomization(vnfVfmoduleCvnfcConfigurationCustomizationSet); + + cvnfcCustomizationRepository.save(cvnfcCustomization); + + List<CvnfcCustomization> cvnfcCustomizationList = cvnfcCustomizationRepository.findByVnfResourceCustomizationAndVfModuleCustomization("cf9f6efc-9f14-11e8-98d0-529269fb1459","cf9f6efc-9f14-11e8-98d0-529269fb1459"); + boolean matchFound = false; + for (CvnfcCustomization foundCvnfcCustomization : cvnfcCustomizationList) { + if (foundCvnfcCustomization.getDescription().equalsIgnoreCase(cvnfcCustomization.getDescription())) { + + assertThat(cvnfcCustomization, sameBeanAs(foundCvnfcCustomization) + .ignoring("id") + .ignoring("created") + .ignoring("vnfVfmoduleCvnfcConfigurationCustomization") + .ignoring("vnfResourceCusteModelCustomizationUUID")); + + matchFound = true; + + Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizations = foundCvnfcCustomization.getVnfVfmoduleCvnfcConfigurationCustomization(); + for(VnfVfmoduleCvnfcConfigurationCustomization customization : vnfVfmoduleCvnfcConfigurationCustomizations) { + Assert.assertTrue(customization.getConfigurationResource().getToscaNodeType().equalsIgnoreCase("toscaNodeType")); + } + break; + } + } + Assert.assertTrue(matchFound); + + } } |