use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateVnfResourceIdInAAISameModelCustomizationIdTest.
@Test
public void validateVnfResourceIdInAAISameModelCustomizationIdTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
GenericVnf vnf = new GenericVnf();
vnf.setVnfId("id123");
vnf.setModelCustomizationId("1234567");
Optional<GenericVnf> opVnf = Optional.of(vnf);
when(bbInputSetupUtilsMock.getRelatedVnfByNameFromServiceInstance("siId123", "vnfName123")).thenReturn(opVnf);
String id = testedObject.validateVnfResourceIdInAAI("generatedId123", "vnfName123", reqDetails, workflowResourceIds);
assertEquals("id123", id);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateVnfResourceIdInAAIDiffModelCustomizationIdTest.
@Test
public void validateVnfResourceIdInAAIDiffModelCustomizationIdTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
GenericVnf vnf = new GenericVnf();
vnf.setModelCustomizationId("9999999");
Optional<GenericVnf> opVnf = Optional.of(vnf);
when(bbInputSetupUtilsMock.getRelatedVnfByNameFromServiceInstance("siId123", "vnfName123")).thenReturn(opVnf);
this.expectedException.expect(DuplicateNameException.class);
this.expectedException.expectMessage(containsString("generic-vnf with name (vnfName123), same parent and different customization id (9999999) already exists. The name must be unique."));
testedObject.validateVnfResourceIdInAAI("generatedId123", "vnfName123", reqDetails, workflowResourceIds);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateVfModuleResourceIdTest.
@Test
public void validateVfModuleResourceIdTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
String id = testedObject.validateVfModuleResourceIdInAAI("generatedId123", "name123", reqDetails, new WorkflowResourceIds());
assertEquals("generatedId123", id);
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateResourceIdInAAIVnfNotGloballyUniqueTest.
@Test
public void validateResourceIdInAAIVnfNotGloballyUniqueTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
GenericVnfs genericVnfs = new GenericVnfs();
GenericVnf vnf3 = new GenericVnf();
vnf3.setVnfId("id123");
genericVnfs.getGenericVnf().add(vnf3);
when(bbInputSetupUtilsMock.getAAIVnfsGloballyByName("vnfName333")).thenReturn(genericVnfs);
this.expectedException.expect(DuplicateNameException.class);
this.expectedException.expectMessage(containsString("generic-vnf with name (vnfName333) id (id123) and different parent relationship already exists. The name must be unique."));
testedObject.validateResourceIdInAAI("generatedId123", WorkflowType.VNF, "vnfName333", reqDetails, new WorkflowResourceIds());
}
use of org.onap.so.serviceinstancebeans.RequestDetails in project so by onap.
the class AaiResourceIdValidatorTest method validateConfigurationResourceIdInAAITest.
@Test
public void validateConfigurationResourceIdInAAITest() throws Exception {
RequestDetails reqDetails = setupRequestDetails();
String id = testedObject.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails, new WorkflowResourceIds());
assertEquals("generatedId123", id);
}
Aggregations