use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateServiceResourceIdInAAIDuplicateNameMultipleTest.
@Test
public void validateServiceResourceIdInAAIDuplicateNameMultipleTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
ServiceInstances serviceInstances = new ServiceInstances();
serviceInstances.getServiceInstance().add(new ServiceInstance());
serviceInstances.getServiceInstance().add(new ServiceInstance());
when(bbInputSetupUtilsMock.getAAIServiceInstancesGloballyByName("siName")).thenReturn(serviceInstances);
this.expectedException.expect(DuplicateNameException.class);
this.expectedException.expectMessage(containsString("serviceInstance with name (siName) and multiple combination of model-version-id + service-type + global-customer-id already exists. The name must be unique."));
testedObject.validateServiceResourceIdInAAI("generatedId123", "siName", reqDetails);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateVolumeGroupResourceIdInAAITest.
@Test
public void validateVolumeGroupResourceIdInAAITest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
String id = testedObject.validateVolumeGroupResourceIdInAAI("generatedId123", "name123", reqDetails, new WorkflowResourceIds());
assertEquals("generatedId123", id);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateConfigurationResourceIdInAAINotGloballyUniqueTest.
@Test
public void validateConfigurationResourceIdInAAINotGloballyUniqueTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
when(bbInputSetupUtilsMock.existsAAIConfigurationGloballyByName("name123")).thenReturn(true);
this.expectedException.expect(DuplicateNameException.class);
this.expectedException.expectMessage(containsString("configuration with name name123 already exists. The name must be unique."));
testedObject.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateVfModuleResourceIdDifferentModelCustIdTest.
@Test
public void validateVfModuleResourceIdDifferentModelCustIdTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setVnfId("vnfId123");
VfModules vfModules = new VfModules();
VfModule vfModule = new VfModule();
vfModule.setVfModuleName("name123");
vfModule.setModelCustomizationId("9999999");
vfModules.getVfModule().add(vfModule);
GenericVnf vnf = new GenericVnf();
vnf.setVfModules(vfModules);
when(bbInputSetupUtilsMock.getAAIGenericVnf("vnfId123")).thenReturn(vnf);
this.expectedException.expect(DuplicateNameException.class);
this.expectedException.expectMessage(containsString("vfModule with name (name123), same parent and different customization id (1234567) already exists. The name must be unique."));
testedObject.validateVfModuleResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateNetworkResourceIdInAAISameModelCustIdTest.
@Test
public void validateNetworkResourceIdInAAISameModelCustIdTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
L3Network network = new L3Network();
network.setNetworkId("id123");
network.setModelCustomizationId("1234567");
Optional<L3Network> opNetwork = Optional.of(network);
when(bbInputSetupUtilsMock.getRelatedNetworkByNameFromServiceInstance("siId123", "name123")).thenReturn(opNetwork);
String id = testedObject.validateNetworkResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
assertEquals("id123", id);
}
Aggregations