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);
}
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);
}
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;
}
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);
}
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());
}
Aggregations