Search in sources :

Example 1 with Manifest

use of org.onap.so.apihandlerinfra.tenantisolationbeans.Manifest in project so by onap.

the class ActivateVnfOperationalEnvironmentTest method executionTest.

@Test
public void executionTest() throws Exception {
    List<ServiceModelList> serviceModelVersionIdList = new ArrayList<>();
    ServiceModelList serviceModelList1 = new ServiceModelList();
    serviceModelList1.setRecoveryAction(RecoveryAction.retry);
    serviceModelList1.setServiceModelVersionId(serviceModelVersionId);
    serviceModelVersionIdList.add(serviceModelList1);
    RequestDetails requestDetails = new RequestDetails();
    RequestParameters requestParameters = new RequestParameters();
    Manifest manifest = new Manifest();
    manifest.setServiceModelList(serviceModelVersionIdList);
    requestParameters.setManifest(manifest);
    requestParameters.setWorkloadContext(workloadContext);
    requestDetails.setRequestParameters(requestParameters);
    request.setOperationalEnvironmentId(vnfOperationalEnvironmentId);
    request.setRequestDetails(requestDetails);
    JSONObject jsonObject = new JSONObject();
    jsonObject.put("statusCode", "202");
    jsonObject.put("message", "Success");
    jsonObject.put("distributionId", sdcDistributionId);
    wireMockServer.stubFor(get(urlPathMatching("/aai/" + AAIVersion.LATEST + "/cloud-infrastructure/operational-environments/.*")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/activateOperationalEnvironmentWithRelationship.json").withStatus(HttpStatus.SC_ACCEPTED)));
    wireMockServer.stubFor(post(urlPathMatching("/sdc/v1/catalog/services/TEST_serviceModelVersionId/distr.*")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(jsonObject.toString()).withStatus(HttpStatus.SC_ACCEPTED)));
    activateVnf.execute(requestId, request);
}
Also used : ServiceModelList(org.onap.so.apihandlerinfra.tenantisolationbeans.ServiceModelList) JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) Manifest(org.onap.so.apihandlerinfra.tenantisolationbeans.Manifest) RequestDetails(org.onap.so.apihandlerinfra.tenantisolationbeans.RequestDetails) RequestParameters(org.onap.so.apihandlerinfra.tenantisolationbeans.RequestParameters) BaseTest(org.onap.so.apihandlerinfra.BaseTest) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 JSONObject (org.json.JSONObject)1 Test (org.junit.Test)1 BaseTest (org.onap.so.apihandlerinfra.BaseTest)1 Manifest (org.onap.so.apihandlerinfra.tenantisolationbeans.Manifest)1 RequestDetails (org.onap.so.apihandlerinfra.tenantisolationbeans.RequestDetails)1 RequestParameters (org.onap.so.apihandlerinfra.tenantisolationbeans.RequestParameters)1 ServiceModelList (org.onap.so.apihandlerinfra.tenantisolationbeans.ServiceModelList)1