diff options
author | 2018-07-30 15:56:09 -0400 | |
---|---|---|
committer | 2018-07-31 11:09:25 -0400 | |
commit | 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch) | |
tree | 59a968f27b4b603aacc9d5e7b51fb598aeec5321 /mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/tenantisolationbeans/CloudOrchestrationTest.java | |
parent | b6dc38501f3b746426b42d9de4cc883d894149e8 (diff) |
Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/tenantisolationbeans/CloudOrchestrationTest.java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/tenantisolationbeans/CloudOrchestrationTest.java | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/tenantisolationbeans/CloudOrchestrationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/tenantisolationbeans/CloudOrchestrationTest.java deleted file mode 100644 index 74ff9078b5..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/tenantisolationbeans/CloudOrchestrationTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.apihandlerinfra.tenantisolationbeans; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; - -import javax.ws.rs.core.Response; - -import org.apache.http.HttpStatus; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.mso.apihandler.common.ValidationException; -import org.openecomp.mso.apihandlerinfra.tenantisolation.CloudOrchestration; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; - -public class CloudOrchestrationTest { - - private static final String requestJSONCreate = "{\"requestDetails\": {\"requestInfo\": {\"resourceType\": \"operationalEnvironment\",\"instanceName\": " - + "\"myOpEnv\",\"source\": \"VID\",\"requestorId\": \"az2017\"},\"requestParameters\": {\"operationalEnvironmentType\": \"ECOMP\", " - + "\"tenantContext\": \"Test\",\"workloadContext\": \"ECOMP_E2E-IST\"}}} "; - - private static final String requestJsonActivate = "{\"requestDetails\": {\"requestInfo\": {\"resourceType\": \"operationalEnvironment\"," - + "\"instanceName\": \"myVnfOpEnv\",\"source\": \"VID\",\"requestorId\": \"az2017\"}," - + "\"relatedInstanceList\": [{\"relatedInstance\": {\"resourceType\": \"operationalEnvironment\"," - + "\"instanceId\": \"ff305d54-75b4-431b-adb2-eb6b9e5ff000\",\"instanceName\": \"name\"}}]," - + "\"requestParameters\": { \"operationalEnvironmentType\": \"VNF\",\"workloadContext\": \"VNF_E2E-IST\"," - + "\"manifest\": {\"serviceModelList\": [{\"serviceModelVersionId\": \"ff305d54-75b4-431b-adb2-eb6b9e5ff000\"," - + "\"recoveryAction\": \"abort\"},{\"serviceModelVersionId\": \"ff305d54-75b4-431b-adb2-eb6b9e5ff000\"," - + "\"recoveryAction\": \"retry\"}]} }}}"; - - private static final String requestJsonDeactivate = "{\"requestDetails\": {\"requestInfo\": {\"resourceType\": \"operationalEnvironment\"," - + "\"source\": \"VID\",\"requestorId\": \"az2017\"},\"requestParameters\": " - + "{\"operationalEnvironmentType\": \"VNF\"}}}"; - - @Test - public void testCreateOperationEnvironment() - throws JsonParseException, JsonMappingException, IOException, ValidationException { - final String response = "{\"requestId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"," - + "\"instanceId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"}"; - final Response okResponse = Response.status(HttpStatus.SC_OK).entity(response).build(); - - try { - CloudOrchestration cor = Mockito.mock(CloudOrchestration.class); - cor.createOperationEnvironment(requestJSONCreate, "v1"); - Mockito.when(cor.createOperationEnvironment(requestJSONCreate, "v1")).thenReturn(okResponse); - Response resp = cor.createOperationEnvironment(requestJSONCreate, "v1"); - assertEquals(resp.getStatus(), HttpStatus.SC_OK); - } catch (Exception e) { - - e.printStackTrace(); - } - } - - @Test - public void testActivateOperationEnvironment() - throws JsonParseException, JsonMappingException, IOException, ValidationException { - final String response = "{\"requestId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"," - + "\"instanceId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"}"; - final Response okResponse = Response.status(HttpStatus.SC_OK).entity(response).build(); - - try { - CloudOrchestration cor = Mockito.mock(CloudOrchestration.class); - cor.activateOperationEnvironment(requestJsonActivate, "v1", "ff3514e3-5a33-55df-13ab-12abad84e7ff"); - Mockito.when(cor.activateOperationEnvironment(requestJsonActivate, "v1", "ff3514e3-5a33-55df-13ab-12abad84e7ff")).thenReturn(okResponse); - Response resp = cor.activateOperationEnvironment(requestJsonActivate, "v1", "ff3514e3-5a33-55df-13ab-12abad84e7ff"); - assertEquals(resp.getStatus(), HttpStatus.SC_OK); - } catch (Exception e) { - - e.printStackTrace(); - } - } - - @Test - public void testDeactivateOperationEnvironment() - throws JsonParseException, JsonMappingException, IOException, ValidationException { - final String response = "{\"requestId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"," - + "\"instanceId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"}"; - final Response okResponse = Response.status(HttpStatus.SC_OK).entity(response).build(); - - try { - CloudOrchestration cor = Mockito.mock(CloudOrchestration.class); - cor.deactivateOperationEnvironment(requestJsonDeactivate, "v1", "ff3514e3-5a33-55df-13ab-12abad84e7ff"); - Mockito.when(cor.deactivateOperationEnvironment(requestJsonDeactivate, "v1", "ff3514e3-5a33-55df-13ab-12abad84e7ff")).thenReturn(okResponse); - Response resp = cor.deactivateOperationEnvironment(requestJsonDeactivate, "v1", "ff3514e3-5a33-55df-13ab-12abad84e7ff"); - assertEquals(resp.getStatus(), HttpStatus.SC_OK); - } catch (Exception e) { - - e.printStackTrace(); - } - } -} |