use of org.onap.so.db.catalog.beans.PnfResource in project so by onap.
the class CatalogDbClientTest method getPnfResourceCustomizationByModelCustomizationUUID_validUuid_expectedOutput.
@Test
public void getPnfResourceCustomizationByModelCustomizationUUID_validUuid_expectedOutput() {
PnfResourceCustomization pnfResourceCustomization = client.getPnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002680");
assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName());
assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName());
assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion());
assertTrue("skip post instantiation configuration", pnfResourceCustomization.getSkipPostInstConf());
PnfResource pnfResource = pnfResourceCustomization.getPnfResources();
assertNotNull(pnfResource);
assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680", pnfResource.getModelInvariantUUID());
assertEquals("PNFResource modelVersion", "1.0", pnfResource.getModelVersion());
assertEquals("PNFResource orchestration mode", "", pnfResource.getOrchestrationMode());
}
use of org.onap.so.db.catalog.beans.PnfResource in project so by onap.
the class ToscaResourceInstaller method createPnfResource.
/**
* Construct the {@link PnfResource} from {@link IEntityDetails} object.
*/
private PnfResource createPnfResource(IEntityDetails entity) {
PnfResource pnfResource = new PnfResource();
Metadata metadata = entity.getMetadata();
pnfResource.setModelInvariantUUID(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
pnfResource.setModelName(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
pnfResource.setModelUUID(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
pnfResource.setModelVersion(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
pnfResource.setDescription(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
pnfResource.setCategory(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)));
pnfResource.setSubCategory(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
pnfResource.setToscaNodeType(entity.getToscaType());
return pnfResource;
}
use of org.onap.so.db.catalog.beans.PnfResource in project so by onap.
the class PnfCustomizationRepositoryTest method checkPnfResourceCustomization.
private void checkPnfResourceCustomization(PnfResourceCustomization pnfResourceCustomization) {
assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName());
assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName());
assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion());
assertTrue("skip post instantiation configuration", pnfResourceCustomization.getSkipPostInstConf());
PnfResource pnfResource = pnfResourceCustomization.getPnfResources();
assertNotNull(pnfResource);
assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680", pnfResource.getModelInvariantUUID());
assertEquals("PNFResource modelVersion", "1.0", pnfResource.getModelVersion());
assertEquals("PNFResource orchestration mode", "", pnfResource.getOrchestrationMode());
}
use of org.onap.so.db.catalog.beans.PnfResource in project so by onap.
the class PnfResourceRepositoryTest method findResourceById_validUuid_expectedOutput.
@Test
public void findResourceById_validUuid_expectedOutput() throws Exception {
PnfResource pnfResource = pnfResourceRepository.findById("ff2ae348-214a-11e7-93ae-92361f002680").orElseThrow(() -> new NoEntityFoundException("Cannot Find Entity"));
checkPnfResource(pnfResource);
}
Aggregations