Search in sources :

Example 86 with RequestDetails

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

the class AaiResourceIdValidatorTest method validateNetworkResourceIdInAAITest.

@Test
public void validateNetworkResourceIdInAAITest() throws Exception {
    RequestDetails reqDetails = setupRequestDetails();
    String id = testedObject.validateNetworkResourceIdInAAI("generatedId123", "name123", reqDetails, new WorkflowResourceIds());
    assertEquals("generatedId123", id);
}
Also used : CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) WorkflowResourceIds(org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds) Test(org.junit.Test)

Example 87 with RequestDetails

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

the class AaiResourceIdValidatorTest method validateConfigurationResourceIdInAAISameModelCustIdTest.

@Test
public void validateConfigurationResourceIdInAAISameModelCustIdTest() throws Exception {
    RequestDetails reqDetails = setupRequestDetails();
    WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
    workflowResourceIds.setServiceInstanceId("siId123");
    org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration();
    configuration.setConfigurationId("id123");
    configuration.setModelCustomizationId("1234567");
    Optional<org.onap.aai.domain.yang.Configuration> opConfiguration = Optional.of(configuration);
    when(bbInputSetupUtilsMock.getRelatedConfigurationByNameFromServiceInstance("siId123", "name123")).thenReturn(opConfiguration);
    String id = testedObject.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
    assertEquals("id123", id);
}
Also used : CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) WorkflowResourceIds(org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds) Test(org.junit.Test)

Example 88 with RequestDetails

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

the class E2EServiceInstances method mapReqJsonToSvcInstReq.

/**
 * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and passing it to camunda engine.
 *
 * @param e2eSir
 * @return
 */
private ServiceInstancesRequest mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir, String requestJSON) {
    ServiceInstancesRequest sir = new ServiceInstancesRequest();
    RequestDetails requestDetails = new RequestDetails();
    ModelInfo modelInfo = new ModelInfo();
    // ModelInvariantId
    modelInfo.setModelInvariantId(e2eSir.getService().getServiceInvariantUuid());
    // modelNameVersionId
    modelInfo.setModelNameVersionId(e2eSir.getService().getServiceUuid());
    // String modelInfoValue =
    // e2eSir.getService().getParameters().getNodeTemplateName();
    // String[] arrayOfInfo = modelInfoValue.split(":");
    // String modelName = arrayOfInfo[0];
    // String modelVersion = arrayOfInfo[1];
    // TODO: To ensure, if we dont get the values from the UUI
    String modelName = "voLTE";
    String modelVersion = "1.0";
    // modelName
    modelInfo.setModelName(modelName);
    // modelVersion
    modelInfo.setModelVersion(modelVersion);
    // modelType
    modelInfo.setModelType(ModelType.service);
    // setting modelInfo to requestDetails
    requestDetails.setModelInfo(modelInfo);
    SubscriberInfo subscriberInfo = new SubscriberInfo();
    // globalsubscriberId
    subscriberInfo.setGlobalSubscriberId(e2eSir.getService().getGlobalSubscriberId());
    // setting subscriberInfo to requestDetails
    requestDetails.setSubscriberInfo(subscriberInfo);
    RequestInfo requestInfo = new RequestInfo();
    // instanceName
    requestInfo.setInstanceName(e2eSir.getService().getName());
    // source
    requestInfo.setSource("UUI");
    // suppressRollback
    requestInfo.setSuppressRollback(true);
    // setting requestInfo to requestDetails
    requestDetails.setRequestInfo(requestInfo);
    RequestParameters requestParameters = new RequestParameters();
    // subscriptionServiceType
    requestParameters.setSubscriptionServiceType("MOG");
    List<Map<String, Object>> userParamList = new ArrayList<>();
    Map<String, Object> userParamMap = new HashMap<>();
    // complete json request updated in the camunda
    userParamMap.put("UUIRequest", requestJSON);
    userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());
    userParamList.add(userParamMap);
    requestParameters.setUserParams(userParamList);
    // setting requestParameters to requestDetails
    requestDetails.setRequestParameters(requestParameters);
    sir.setRequestDetails(requestDetails);
    return sir;
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) RequestInfo(org.onap.so.serviceinstancebeans.RequestInfo) ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) RequestParameters(org.onap.so.serviceinstancebeans.RequestParameters) JSONObject(org.json.JSONObject) Map(java.util.Map) HashMap(java.util.HashMap) SubscriberInfo(org.onap.so.serviceinstancebeans.SubscriberInfo)

Example 89 with RequestDetails

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

the class ServiceInstanceDeleteValidatorTest method before.

@Before
public void before() {
    serviceInstancesRequest = new ServiceInstancesRequest();
    RequestDetails requestDetails = new RequestDetails();
    RequestParameters requestParameters = new RequestParameters();
    requestParameters.setaLaCarte(true);
    requestDetails.setRequestParameters(requestParameters);
    serviceInstancesRequest.setRequestDetails(requestDetails);
}
Also used : ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) RequestParameters(org.onap.so.serviceinstancebeans.RequestParameters) Before(org.junit.Before)

Example 90 with RequestDetails

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

the class VolumeGroupDeleteValidatorTest method validateFailureVnfTest.

@Test
public void validateFailureVnfTest() {
    instanceIdMap.put("volumeGroupInstanceId", "1");
    ServiceInstancesRequest request = new ServiceInstancesRequest();
    RequestDetails details = new RequestDetails();
    details.setCloudConfiguration(new CloudConfiguration());
    request.setRequestDetails(details);
    when(aaiDataRetrieval.isVolumeGroupRelatedToVFModule(any(CloudConfiguration.class), eq("1"))).thenReturn(true);
    Optional<String> result = volumeGroupDeleteValidator.validate(instanceIdMap, request, null, null);
    assertEquals(true, result.isPresent());
}
Also used : CloudConfiguration(org.onap.so.serviceinstancebeans.CloudConfiguration) ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) Test(org.junit.Test)

Aggregations

RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)163 Test (org.junit.Test)126 Service (org.onap.so.db.catalog.beans.Service)55 File (java.io.File)52 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)51 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)47 WorkflowResourceIds (org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds)43 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)42 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)38 HashMap (java.util.HashMap)37 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)36 ServiceInstancesRequest (org.onap.so.serviceinstancebeans.ServiceInstancesRequest)36 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)35 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)27 RequestInfo (org.onap.so.serviceinstancebeans.RequestInfo)27 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)23 ConfigurationResourceKeys (org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys)21 CloudConfiguration (org.onap.so.serviceinstancebeans.CloudConfiguration)20 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)19 GenericVnf (org.onap.aai.domain.yang.GenericVnf)18