Search in sources :

Example 1 with Tenant

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));
}
Also used : Tenant(org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant) Test(org.junit.Test)

Example 2 with Tenant

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;
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) Tenant(org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant)

Example 3 with Tenant

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;
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) Tenant(org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) OrchestrationContext(org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext)

Example 4 with Tenant

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);
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) Tenant(org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) Before(org.junit.Before)

Example 5 with 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;
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) Tenant(org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)

Aggregations

Tenant (org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant)5 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)4 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)3 Before (org.junit.Before)1 Test (org.junit.Test)1 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)1 OrchestrationContext (org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext)1 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)1