b74fe49b9044468c121149ff49fcdb40d16820c5
[so.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - SO
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20 package org.openecomp.mso.adapters.vnf;
21
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;
27
28 public class VnfAdapterRestV2ExceptionTest {
29
30     VnfAdapterRestV2 vnfAdapterRestV2 = new VnfAdapterRestV2();
31
32     @Test(expected = ClassFormatError.class)
33     public void healthcheck() throws Exception {
34         vnfAdapterRestV2.healthcheck();
35     }
36
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);
43     }
44
45     @Test(expected = NullPointerException.class)
46     public void queryVfModuleNullPointerException() throws Exception {
47         vnfAdapterRestV2.queryVfModule("vnfid", "moduleid", "cloudid", "teanantid", "vfmodulename", true, "requestid", "serviceinstanceid", "mode");
48     }
49
50     @Test(expected = ClassFormatError.class)
51     public void createVfModuleClassFormatError() throws Exception {
52         vnfAdapterRestV2.createVfModule("vnfid", "create", new CreateVfModuleRequest());
53     }
54
55     @Test(expected = ClassFormatError.class)
56     public void updateVfModulClassFormatErrore() throws Exception {
57         vnfAdapterRestV2.updateVfModule("vnfid", "moduleid", "mode", new UpdateVfModuleRequest());
58     }
59
60     @Test(expected = NullPointerException.class)
61     public void rollbackVfModuleNullPointerException() throws Exception {
62         vnfAdapterRestV2.rollbackVfModule("vnfid", "moduleid", new RollbackVfModuleRequest());
63     }
64
65 }