use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class BpmnRequestBuilderTest method test_buildVFModuleDeleteRequest.
@Test
public void test_buildVFModuleDeleteRequest() throws Exception {
GenericVnf vnf = provider.getMapper().readValue(new File(RESOURCE_PATH + "Vnf.json"), GenericVnf.class);
doReturn(Optional.of(vnf)).when(aaiResourcesClient).get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId")));
VfModule vfModule = provider.getMapper().readValue(new File(RESOURCE_PATH + "VfModule.json"), VfModule.class);
doReturn(Optional.of(vfModule)).when(aaiResourcesClient).get(VfModule.class, AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId").vfModule("vfModuleId")));
ServiceInstancesRequest expectedRequest = mapper.readValue(new File(RESOURCE_PATH + "ExpectedVfModuleRequest.json"), ServiceInstancesRequest.class);
ServiceInstancesRequest actualRequest = reqBuilder.buildVFModuleDeleteRequest("vnfId", "vfModuleId", ModelType.vfModule);
assertThat(actualRequest, sameBeanAs(expectedRequest));
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class NetworkRestHandlerTest method test_saveInstanceName.
@Test
public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).updateInfraActiveRequests(dbRequest);
assertEquals("InstanceName Should Be Equal", "instanceName", dbRequest.getNetworkName());
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class NetworkRestHandlerTest method createTestRequest.
private ServiceInstancesRequest createTestRequest() {
ServiceInstancesRequest request = new ServiceInstancesRequest();
RequestDetails requestDetails = new RequestDetails();
RequestInfo requestInfo = new RequestInfo();
requestInfo.setInstanceName("instanceName");
requestDetails.setRequestInfo(requestInfo);
request.setRequestDetails(requestDetails);
return request;
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class VnfRestHandlerTest method test_saveInstanceName.
@Test
public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).updateInfraActiveRequests(dbRequest);
assertEquals("InstanceName Should Be Equal", "instanceName", dbRequest.getVnfName());
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class VnfRestHandlerTest method createTestRequest.
private ServiceInstancesRequest createTestRequest() {
ServiceInstancesRequest request = new ServiceInstancesRequest();
RequestDetails requestDetails = new RequestDetails();
RequestInfo requestInfo = new RequestInfo();
requestInfo.setInstanceName("instanceName");
requestDetails.setRequestInfo(requestInfo);
request.setRequestDetails(requestDetails);
return request;
}
Aggregations