Updating Nokia driver
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / test / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / spring / TestRealConfig.java
1 /*
2  * Copyright 2016-2017, Nokia Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring;
18
19 import com.nokia.cbam.lcm.v32.model.VnfIdentifierCreationNotification;
20 import com.nokia.cbam.lcm.v32.model.VnfIdentifierDeletionNotification;
21 import com.nokia.cbam.lcm.v32.model.VnfInfoAttributeValueChangeNotification;
22 import com.nokia.cbam.lcm.v32.model.VnfLifecycleChangeNotification;
23 import org.junit.Test;
24 import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
25 import org.springframework.http.MediaType;
26
27 public class TestRealConfig {
28
29     /**
30      * test that the converter can transform the inherited classes
31      */
32     @Test
33     public void test() throws Exception {
34         HttpMessageConverters converters = new RealConfig().customConverters();
35         //verify
36         converters.getConverters().get(0).canRead(VnfIdentifierCreationNotification.class, MediaType.APPLICATION_JSON);
37         converters.getConverters().get(0).canRead(VnfIdentifierDeletionNotification.class, MediaType.APPLICATION_JSON);
38         converters.getConverters().get(0).canRead(VnfInfoAttributeValueChangeNotification.class, MediaType.APPLICATION_JSON);
39         converters.getConverters().get(0).canRead(VnfLifecycleChangeNotification.class, MediaType.APPLICATION_JSON);
40         converters.getConverters().get(0).canRead(String.class, MediaType.APPLICATION_JSON);
41     }
42
43 }