use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class RequestHandlerUtilsTest method setServiceTypeTestNetwork.
@Test
public void setServiceTypeTestNetwork() throws JsonProcessingException {
String requestScope = ModelType.network.toString();
Boolean aLaCarteFlag = null;
ServiceInstancesRequest sir = new ServiceInstancesRequest();
RequestDetails requestDetails = new RequestDetails();
RequestInfo requestInfo = new RequestInfo();
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelName("networkModelName");
requestInfo.setSource("VID");
requestDetails.setModelInfo(modelInfo);
requestDetails.setRequestInfo(requestInfo);
sir.setRequestDetails(requestDetails);
String serviceType = requestHandlerUtils.getServiceType(requestScope, sir, aLaCarteFlag);
assertEquals(serviceType, "networkModelName");
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class RequestHandlerUtilsTest method test_mapJSONtoMSOStyleCustomWorkflowRequest.
@Test
public void test_mapJSONtoMSOStyleCustomWorkflowRequest() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(Include.NON_NULL);
String testRequest = inputStream("/CustomWorkflowRequest.json");
String resultString = requestHandlerUtils.mapJSONtoMSOStyle(testRequest, null, true, Action.inPlaceSoftwareUpdate);
ServiceInstancesRequest sir = mapper.readValue(resultString, ServiceInstancesRequest.class);
assertEquals(sir.getRequestDetails().getCloudConfiguration().getTenantId(), "88a6ca3ee0394ade9403f075db23167e");
assertNotEquals(sir.getRequestDetails().getRequestParameters().getUserParams().size(), 0);
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class RequestHandlerUtilsTest method setServiceInstanceIdInstanceGroupTest.
@Test
public void setServiceInstanceIdInstanceGroupTest() throws JsonParseException, JsonMappingException, IOException {
String requestScope = "instanceGroup";
ServiceInstancesRequest sir = mapper.readValue(inputStream("/CreateInstanceGroup.json"), ServiceInstancesRequest.class);
assertEquals("ddcbbf3d-f2c1-4ca0-8852-76a807285efc", requestHandlerUtils.setServiceInstanceId(requestScope, sir));
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class RequestHandlerUtilsTest 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));
}
use of org.onap.so.serviceinstancebeans.ServiceInstancesRequest in project so by onap.
the class RequestHandlerUtilsTest method test_mapJSONtoMSOStyleUsePreload.
@Test
public void test_mapJSONtoMSOStyleUsePreload() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(Include.NON_NULL);
String testRequest = inputStream("/ServiceInstanceDefault.json");
ServiceInstancesRequest sir = new ServiceInstancesRequest();
RequestDetails rd = new RequestDetails();
RequestParameters rp = new RequestParameters();
rp.setUsePreload(true);
rd.setRequestParameters(rp);
sir.setRequestDetails(rd);
String resultString = requestHandlerUtils.mapJSONtoMSOStyle(testRequest, sir, false, null);
ServiceInstancesRequest sir1 = mapper.readValue(resultString, ServiceInstancesRequest.class);
assertTrue(sir1.getRequestDetails().getRequestParameters().getUsePreload());
}
Aggregations