Search in sources :

Example 41 with CloudConfiguration

use of org.onap.so.serviceinstancebeans.CloudConfiguration in project so by onap.

the class BpmnRequestBuilderTest method test_getCloudConfigurationVfModuleReplace.

@Test
public void test_getCloudConfigurationVfModuleReplace() throws Exception {
    String vnfId = "vnfId";
    String vfModuleId = "vfModuleId";
    GenericVnf vnf = provider.getMapper().readValue(new File(RESOURCE_PATH + "Vnf.json"), GenericVnf.class);
    doReturn(Optional.of(vnf)).when(aaiResourcesClient).get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId)));
    CloudConfiguration result = reqBuilder.getCloudConfigurationVfModuleReplace(vnfId, vfModuleId);
    assertEquals("0422ffb57ba042c0800a29dc85ca70f8", result.getTenantId());
    assertEquals("cloudOwner", result.getCloudOwner());
    assertEquals("regionOne", result.getLcpCloudRegionId());
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf) CloudConfiguration(org.onap.so.serviceinstancebeans.CloudConfiguration) File(java.io.File) Test(org.junit.Test)

Example 42 with CloudConfiguration

use of org.onap.so.serviceinstancebeans.CloudConfiguration in project so by onap.

the class ServiceInstancesUnitTest method setCloudConfigurationCurrentActiveRequestTest.

@Test
public void setCloudConfigurationCurrentActiveRequestTest() {
    CloudConfiguration cloudConfiguration = new CloudConfiguration();
    cloudConfiguration.setTenantId("tenantId");
    cloudConfiguration.setLcpCloudRegionId("lcpCloudRegionId");
    InfraActiveRequests currentActiveRequest = new InfraActiveRequests();
    serviceInstances.setCloudConfigurationCurrentActiveRequest(cloudConfiguration, currentActiveRequest);
    assertEquals("tenantId", currentActiveRequest.getTenantId());
    assertEquals("lcpCloudRegionId", currentActiveRequest.getCloudRegion());
}
Also used : CloudConfiguration(org.onap.so.serviceinstancebeans.CloudConfiguration) InfraActiveRequests(org.onap.so.db.request.beans.InfraActiveRequests) Test(org.junit.Test)

Aggregations

CloudConfiguration (org.onap.so.serviceinstancebeans.CloudConfiguration)42 Test (org.junit.Test)28 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)15 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)15 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)15 HashMap (java.util.HashMap)13 Service (org.onap.so.db.catalog.beans.Service)13 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)13 File (java.io.File)12 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)12 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)12 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)11 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)11 ServiceInstancesRequest (org.onap.so.serviceinstancebeans.ServiceInstancesRequest)10 ModelInfoGenericVnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf)9 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)8 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)8 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)7 ConfigurationResourceKeys (org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys)7 CloudConfigurationNotFoundException (org.onap.so.apihandlerinfra.infra.rest.exception.CloudConfigurationNotFoundException)6