use of org.onap.aai.domain.yang.VolumeGroup in project so by onap.
the class WorkflowActionBBTasksTest method setVolumeGroupNameTest.
@Test
public void setVolumeGroupNameTest() {
String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
WorkflowType resourceType = WorkflowType.VOLUMEGROUP;
InfraActiveRequests request = new InfraActiveRequests();
request.setVnfId("4aa72c90-21eb-4465-8847-997e27af6c3e");
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupName("volumeGroupName");
Optional<VolumeGroup> returnVolumeGroup = Optional.of(volumeGroup);
doReturn(returnVolumeGroup).when(bbSetupUtils).getRelatedVolumeGroupByIdFromVnf(request.getVnfId(), resourceId);
workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
assertEquals("volumeGroupName", request.getVolumeGroupName());
}
use of org.onap.aai.domain.yang.VolumeGroup in project so by onap.
the class AaiResourceIdValidatorTest method validateVolumeGroupResourceIdInAAISameModelCustIdTest.
@Test
public void validateVolumeGroupResourceIdInAAISameModelCustIdTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setVnfId("vnfId123");
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupId("id123");
volumeGroup.setVfModuleModelCustomizationId("1234567");
Optional<VolumeGroup> opVolumeGroup = Optional.of(volumeGroup);
when(bbInputSetupUtilsMock.getRelatedVolumeGroupByNameFromVnf("vnfId123", "name123")).thenReturn(opVolumeGroup);
String id = testedObject.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "name123", reqDetails, workflowResourceIds);
assertEquals("id123", id);
}
use of org.onap.aai.domain.yang.VolumeGroup in project so by onap.
the class AaiResourceIdValidatorTest method validateResourceIdInAAIVolumeGroupTest.
@Test
public void validateResourceIdInAAIVolumeGroupTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setVnfId("id123");
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupId("id123");
volumeGroup.setVolumeGroupName("name123");
volumeGroup.setVfModuleModelCustomizationId("1234567");
Optional<VolumeGroup> opVolumeGroup = Optional.of(volumeGroup);
when(bbInputSetupUtilsMock.getRelatedVolumeGroupByNameFromVnf("id123", "name123")).thenReturn(opVolumeGroup);
String id = testedObject.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "name123", reqDetails, workflowResourceIds);
assertEquals("id123", id);
String id2 = testedObject.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "111111", reqDetails, workflowResourceIds);
assertEquals("generatedId123", id2);
}
use of org.onap.aai.domain.yang.VolumeGroup in project so by onap.
the class AAIDataRetrievalTest method getVolumeGroupsOfVnfWhenNoneTest.
@Test
public void getVolumeGroupsOfVnfWhenNoneTest() throws Exception {
VolumeGroups volumeGroups = new VolumeGroups();
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId")).relatedTo(Types.VOLUME_GROUPS.getFragment());
doReturn(Optional.of(volumeGroups)).when(aaiResourcesClient).get(VolumeGroups.class, uri);
List<VolumeGroup> volumeGroupList = aaiDataRetrieval.getVolumeGroupsOfVnf("vnfId");
assertEquals(true, volumeGroupList.isEmpty());
Optional<String> volumeGroupIds = aaiDataRetrieval.getVolumeGroupIdsByVnfId("vnfId");
assertEquals(false, volumeGroupIds.isPresent());
}
use of org.onap.aai.domain.yang.VolumeGroup in project so by onap.
the class AAIDataRetrievalTest method getVolumeGroups.
private VolumeGroups getVolumeGroups() {
VolumeGroup volumeGroup1 = new VolumeGroup();
volumeGroup1.setVolumeGroupId("vg1");
VolumeGroup volumeGroup2 = new VolumeGroup();
volumeGroup2.setVolumeGroupId("vg2");
VolumeGroups volumeGroups = new VolumeGroups();
volumeGroups.getVolumeGroup().add(volumeGroup1);
volumeGroups.getVolumeGroup().add(volumeGroup2);
return volumeGroups;
}
Aggregations