use of org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant in project so by onap.
the class BBInputSetupMapperLayerTest method testMapTenant.
@Test
public void testMapTenant() {
Tenant expected = new Tenant();
expected.setTenantId("tenantId");
expected.setTenantName("tenantName");
expected.setTenantContext("tenantContext");
org.onap.aai.domain.yang.Tenant aaiTenant = new org.onap.aai.domain.yang.Tenant();
aaiTenant.setTenantId("tenantId");
aaiTenant.setTenantName("tenantName");
aaiTenant.setTenantContext("tenantContext");
Tenant actual = bbInputSetupMapperLayer.mapTenant(aaiTenant);
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant in project so by onap.
the class BBInputSetup method setCloudConfiguration.
/**
* setCloudConfiguration - set cloud info on a building block.
*
* @param gBB
* @param cloudConfiguration
* @return CloudRegion
* @throws Exception
*/
private CloudRegion setCloudConfiguration(GeneralBuildingBlock gBB, CloudConfiguration cloudConfiguration) throws Exception {
org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(cloudConfiguration);
Tenant tenant = getTenant(cloudConfiguration, aaiCloudRegion);
gBB.setTenant(tenant);
CloudRegion cloudRegion = mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion);
gBB.setCloudRegion(cloudRegion);
return cloudRegion;
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant in project so by onap.
the class BBInputSetup method populateGBBWithSIAndAdditionalInfo.
protected GeneralBuildingBlock populateGBBWithSIAndAdditionalInfo(BBInputSetupParameter parameter) throws Exception {
GeneralBuildingBlock outputBB = new GeneralBuildingBlock();
OrchestrationContext orchContext = mapperLayer.mapOrchestrationContext(parameter.getRequestDetails());
RequestContext requestContext = mapperLayer.mapRequestContext(parameter.getRequestDetails());
requestContext.setAction(parameter.getRequestAction());
requestContext.setMsoRequestId(parameter.getExecuteBB().getRequestId());
requestContext.setIsHelm(parameter.getIsHelm());
org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(parameter.getRequestDetails().getCloudConfiguration());
CloudRegion cloudRegion = mapperLayer.mapCloudRegion(parameter.getRequestDetails().getCloudConfiguration(), aaiCloudRegion);
Tenant tenant = getTenant(parameter.getRequestDetails().getCloudConfiguration(), aaiCloudRegion);
outputBB.setOrchContext(orchContext);
outputBB.setRequestContext(requestContext);
outputBB.setCloudRegion(cloudRegion);
outputBB.setTenant(tenant);
Customer customer = parameter.getCustomer();
if (customer == null) {
Map<String, String> uriKeys = bbInputSetupUtils.getURIKeysFromServiceInstance(parameter.getServiceInstance().getServiceInstanceId());
String globalCustomerId = uriKeys.get(AAIFluentTypeBuilder.Types.CUSTOMER.getUriParams().globalCustomerId);
String subscriptionServiceType = uriKeys.get(AAIFluentTypeBuilder.Types.SERVICE_SUBSCRIPTION.getUriParams().serviceType);
customer = mapCustomer(globalCustomerId, subscriptionServiceType);
}
outputBB.setServiceInstance(parameter.getServiceInstance());
if (customer.getServiceSubscription() != null) {
customer.getServiceSubscription().getServiceInstances().add(parameter.getServiceInstance());
}
outputBB.setCustomer(customer);
return outputBB;
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant in project so by onap.
the class CreateVFModuleTest method before.
@Before
public void before() {
cloudRegion = new CloudRegion();
cloudRegion.setCloudOwner("CloudOwner");
cloudRegion.setLcpCloudRegionId("testRegion");
Tenant tenant = new Tenant();
tenant.setTenantId("tenant-001");
tenant.setTenantName("test-tenant");
tenant.setTenantContext("testContext");
service = setServiceInstance();
genericVnf = setGenericVnf();
vfModule = setVfModule();
gbb = new GeneralBuildingBlock();
gbb.setCloudRegion(cloudRegion);
gbb.setTenant(tenant);
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant in project so by onap.
the class DeleteVfModuleTest method prepareGeneralBuildingBlock.
private GeneralBuildingBlock prepareGeneralBuildingBlock() {
GeneralBuildingBlock generalBuildingBlock = new GeneralBuildingBlock();
CloudRegion cloudRegion = new CloudRegion();
cloudRegion.setCloudOwner(CLOUD_OWNER);
cloudRegion.setLcpCloudRegionId(LCP_CLOUD_REGION_ID);
generalBuildingBlock.setCloudRegion(cloudRegion);
Tenant tenant = new Tenant();
tenant.setTenantId(TENANT_ID);
tenant.setTenantName(TENANT_NAME);
tenant.setTenantContext(TENANT_CONTEXT);
generalBuildingBlock.setTenant(tenant);
return generalBuildingBlock;
}
Aggregations