Search in sources :

Example 96 with ServiceInstancesRequest

use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.

the class ServiceInstanceRestHandlerTest 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;
}
Also used : RequestInfo(org.onap.so.serviceinstancebeans.RequestInfo) ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails)

Example 97 with ServiceInstancesRequest

use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.

the class ServiceInstancesTest method setServiceInstanceIdTest.

@Test
public void setServiceInstanceIdTest() {
    String requestScope = "vnf";
    ServiceInstancesRequest sir = new ServiceInstancesRequest();
    sir.setServiceInstanceId("f0a35706-efc4-4e27-80ea-a995d7a2a40f");
    assertEquals("f0a35706-efc4-4e27-80ea-a995d7a2a40f", requestHandlerUtils.setServiceInstanceId(requestScope, sir));
}
Also used : ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) Test(org.junit.Test)

Example 98 with ServiceInstancesRequest

use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.

the class ServiceInstancesTest method handleReplaceInstance_retainAssignments_Test.

@Test
public void handleReplaceInstance_retainAssignments_Test() throws JsonParseException, JsonMappingException, IOException {
    String replaceVfModule = inputStream("/ReplaceVfModuleRetainAssignments.json");
    ObjectMapper mapper = new ObjectMapper();
    ServiceInstancesRequest sir = mapper.readValue(replaceVfModule, ServiceInstancesRequest.class);
    Actions action = servInstances.handleReplaceInstance(Action.replaceInstance, sir);
    assertEquals(Action.replaceInstanceRetainAssignments, action);
}
Also used : ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) Test(org.junit.Test)

Example 99 with ServiceInstancesRequest

use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.

the class VolumeRestHandlerTest 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.getVolumeGroupName());
}
Also used : InfraActiveRequests(org.onap.so.db.request.beans.InfraActiveRequests) ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) Test(org.junit.Test)

Example 100 with ServiceInstancesRequest

use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.

the class VnfDeleteValidatorTest method createServiceInstancesRequest.

public ServiceInstancesRequest createServiceInstancesRequest(boolean alacarte) {
    ServiceInstancesRequest sir = new ServiceInstancesRequest();
    sir.setRequestDetails(new RequestDetails());
    sir.getRequestDetails().setRequestParameters(new RequestParameters());
    sir.getRequestDetails().getRequestParameters().setaLaCarte(alacarte);
    return sir;
}
Also used : ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) RequestParameters(org.onap.so.serviceinstancebeans.RequestParameters)

Aggregations

ServiceInstancesRequest (org.onap.so.serviceinstancebeans.ServiceInstancesRequest)100 Test (org.junit.Test)58 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)36 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)33 InfraActiveRequests (org.onap.so.db.request.beans.InfraActiveRequests)17 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)15 RequestInfo (org.onap.so.serviceinstancebeans.RequestInfo)15 IOException (java.io.IOException)11 BaseTest (org.onap.so.apihandlerinfra.BaseTest)11 CloudConfiguration (org.onap.so.serviceinstancebeans.CloudConfiguration)11 ValidationException (org.onap.so.exceptions.ValidationException)10 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)8 ValidateException (org.onap.so.apihandlerinfra.exceptions.ValidateException)8 CloudConfigurationNotFoundException (org.onap.so.apihandlerinfra.infra.rest.exception.CloudConfigurationNotFoundException)8 Service (org.onap.so.db.catalog.beans.Service)8 ArrayList (java.util.ArrayList)7 RequestClientParameter (org.onap.so.apihandler.common.RequestClientParameter)7 ApiException (org.onap.so.apihandlerinfra.exceptions.ApiException)7 ServiceInstancesResponse (org.onap.so.serviceinstancebeans.ServiceInstancesResponse)7 GenericVnf (org.onap.aai.domain.yang.GenericVnf)6