2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.mso.adapters.vnf;
22 import org.junit.Test;
23 import org.openecomp.mso.adapters.vnfrest.CreateVfModuleRequest;
24 import org.openecomp.mso.adapters.vnfrest.DeleteVfModuleRequest;
25 import org.openecomp.mso.adapters.vnfrest.RollbackVfModuleRequest;
26 import org.openecomp.mso.adapters.vnfrest.UpdateVfModuleRequest;
28 public class VnfAdapterRestV2ExceptionTest {
32 VnfAdapterRestV2 vnfAdapterRestV2 = new VnfAdapterRestV2();
34 //TODO THESE ARE RAINY DAY TESTS, NEED TO WRITE THE SUNNY DAY ONES
35 // @Test(expected = ClassFormatError.class)
36 public void testHealthcheckFailForInvalidCase() throws Exception {
38 vnfAdapterRestV2.healthcheck();
47 // @Test(expected = ClassFormatError.class)
48 public void deleteVfModuleClassFormatError() throws Exception {
50 DeleteVfModuleRequest deleteVfModuleRequest = new DeleteVfModuleRequest();
51 deleteVfModuleRequest.setVnfId("vnfid");
52 deleteVfModuleRequest.setVfModuleId("moduleid");
53 vnfAdapterRestV2.deleteVfModule("vnfid", "moduleid", "mode", deleteVfModuleRequest);
56 { // EXCEPTION EXPECTED
62 // @Test(expected = NullPointerException.class)
63 public void queryVfModuleNullPointerException() throws Exception {
65 vnfAdapterRestV2.queryVfModule("vnfid", "moduleid", "cloudid", "teanantid", "vfmodulename", true, "requestid", "serviceinstanceid", "mode");
68 { // EXCEPTION EXPECTED
73 // @Test(expected = ClassFormatError.class)
74 public void createVfModuleClassFormatError() throws Exception {
76 vnfAdapterRestV2.createVfModule("vnfid", "create", new CreateVfModuleRequest());
79 { // EXCEPTION EXPECTED
84 // @Test(expected = ClassFormatError.class)
85 public void updateVfModulClassFormatErrore() throws Exception {
87 vnfAdapterRestV2.updateVfModule("vnfid", "moduleid", "mode", new UpdateVfModuleRequest());
90 { // EXCEPTION EXPECTED
95 // @Test(expected = NullPointerException.class)
96 public void rollbackVfModuleNullPointerException() throws Exception {
99 vnfAdapterRestV2.rollbackVfModule("vnfid", "moduleid", new RollbackVfModuleRequest());
103 // EXCEPTION EXPECTED