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 {
30 VnfAdapterRestV2 vnfAdapterRestV2 = new VnfAdapterRestV2();
32 @Test(expected = ClassFormatError.class)
33 public void healthcheck() throws Exception {
34 vnfAdapterRestV2.healthcheck();
37 @Test(expected = ClassFormatError.class)
38 public void deleteVfModuleClassFormatError() throws Exception {
39 DeleteVfModuleRequest deleteVfModuleRequest = new DeleteVfModuleRequest();
40 deleteVfModuleRequest.setVnfId("vnfid");
41 deleteVfModuleRequest.setVfModuleId("moduleid");
42 vnfAdapterRestV2.deleteVfModule("vnfid", "moduleid", "mode", deleteVfModuleRequest);
45 @Test(expected = NullPointerException.class)
46 public void queryVfModuleNullPointerException() throws Exception {
47 vnfAdapterRestV2.queryVfModule("vnfid", "moduleid", "cloudid", "teanantid", "vfmodulename", true, "requestid", "serviceinstanceid", "mode");
50 @Test(expected = ClassFormatError.class)
51 public void createVfModuleClassFormatError() throws Exception {
52 vnfAdapterRestV2.createVfModule("vnfid", "create", new CreateVfModuleRequest());
55 @Test(expected = ClassFormatError.class)
56 public void updateVfModulClassFormatErrore() throws Exception {
57 vnfAdapterRestV2.updateVfModule("vnfid", "moduleid", "mode", new UpdateVfModuleRequest());
60 @Test(expected = NullPointerException.class)
61 public void rollbackVfModuleNullPointerException() throws Exception {
62 vnfAdapterRestV2.rollbackVfModule("vnfid", "moduleid", new RollbackVfModuleRequest());