use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class BpmnRequestBuilder method mapVolumeGroupModelInformation.
protected ModelInfo mapVolumeGroupModelInformation(VolumeGroup volumeGroup) {
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationId(volumeGroup.getModelCustomizationId());
modelInfo.setModelCustomizationUuid(volumeGroup.getModelCustomizationId());
modelInfo.setModelType(ModelType.volumeGroup);
return modelInfo;
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class SkipConfigVnfListenerTest method createExecuteBuildingBlock.
private ExecuteBuildingBlock createExecuteBuildingBlock() {
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelUuid(MODEL_UUID);
RequestDetails requestDetails = new RequestDetails();
requestDetails.setModelInfo(modelInfo);
ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock();
BuildingBlock buildingBlock = new BuildingBlock();
buildingBlock.setKey(VNF_CUSTOMIZATION_UUID);
executeBuildingBlock.setBuildingBlock(buildingBlock);
executeBuildingBlock.setRequestDetails(requestDetails);
return executeBuildingBlock;
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class UpgradePreWorkflowValidatorTest method validateModelInvariantMismatch.
@Test
public void validateModelInvariantMismatch() throws JsonProcessingException {
ServiceInstancesRequest sir = new ServiceInstancesRequest();
sir.setRequestDetails(new RequestDetails());
sir.getRequestDetails().setModelInfo(new ModelInfo());
sir.getRequestDetails().getModelInfo().setModelInvariantId(UUID.randomUUID().toString());
Resource serviceResource = new Resource(WorkflowType.SERVICE, "", false, null);
String aaiModelInvariantId = UUID.randomUUID().toString();
serviceResource.setModelInvariantId(aaiModelInvariantId);
BuildingBlockExecution execution = createExecution(sir, Arrays.asList(serviceResource));
Optional<String> message = validator.validate(execution);
assertTrue(message.isPresent());
assertTrue(message.get().startsWith("Request service modelInvariantId"));
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class UpgradePreWorkflowValidatorTest method validateNoVnfsInAAI.
@Test
public void validateNoVnfsInAAI() throws JsonProcessingException {
ServiceInstancesRequest sir = new ServiceInstancesRequest();
sir.setRequestDetails(new RequestDetails());
sir.getRequestDetails().setModelInfo(new ModelInfo());
String modelInvariantId = UUID.randomUUID().toString();
sir.getRequestDetails().getModelInfo().setModelInvariantId(modelInvariantId);
Resource serviceResource = new Resource(WorkflowType.SERVICE, "", false, null);
serviceResource.setModelInvariantId(modelInvariantId);
BuildingBlockExecution execution = createExecution(sir, Arrays.asList(serviceResource));
Optional<String> message = validator.validate(execution);
assertThat(message).isEmpty();
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class WorkflowActionBBTasksTest method select2BBTest.
@Test
public void select2BBTest() {
String vnfCustomizationUUID = "1234567";
String modelUuid = "1234567";
prepareDelegateExecution();
List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
BuildingBlock buildingBlock = new BuildingBlock().setBpmnFlowName("ConfigDeployVnfBB").setKey(vnfCustomizationUUID);
RequestDetails rd = new RequestDetails();
ModelInfo mi = new ModelInfo();
mi.setModelUuid(modelUuid);
rd.setModelInfo(mi);
ExecuteBuildingBlock ebb = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock).setRequestDetails(rd);
ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock();
flowsToExecute.add(ebb);
List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>();
VnfResourceCustomization vrc = new VnfResourceCustomization();
vrc.setSkipPostInstConf(false);
vrc.setModelCustomizationUUID(vnfCustomizationUUID);
vnfResourceCustomizations.add(vrc);
GenericVnf genericVnf = new GenericVnf();
genericVnf.setModelCustomizationId(vnfCustomizationUUID);
doReturn(vnfResourceCustomizations).when(catalogDbClient).getVnfResourceCustomizationByModelUuid(modelUuid);
doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations);
flowsToExecute.add(ebb2);
execution.setVariable("flowsToExecute", flowsToExecute);
workflowActionBBTasks.selectBB(execution);
boolean success = (boolean) execution.getVariable("completed");
int currentSequence = (int) execution.getVariable("gCurrentSequence");
assertFalse(success);
assertEquals(1, currentSequence);
}
Aggregations