use of org.onap.so.db.catalog.beans.CvnfcCustomization in project so by onap.
the class CvnfcCustomizationRepositoryTest method createAndGetCvnfcCustomizationListTest.
@Test
@Transactional
public void createAndGetCvnfcCustomizationListTest() 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);
vnfResourceCustomization.setVnfResources(vnfResource);
VnfcCustomization vnfcCustomization = setUpVnfcCustomization();
vnfcCustomization.setModelCustomizationUUID("d95d704a-9ff2-11e8-98d0-529269fb1459");
cvnfcCustomizationRepository.save(cvnfcCustomization);
List<CvnfcCustomization> cvnfcCustomizationList = cvnfcCustomizationRepository.findByModelCustomizationUUID("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;
break;
}
}
Assert.assertTrue(matchFound);
}
Aggregations