27236ca792c5c66b44eb705141a27ce00d3f6db4
[vfc/nfvo/driver/vnfm/svnfm.git] /
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
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.vnfm.svnfm.vnfmadapter.service.csm.connect;
18
19 import static org.junit.Assert.*;
20
21 import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
22 import org.junit.Test;
23 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.common.VnfmException;
24 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.csm.connect.SslProtocolSocketFactory;
25
26 public class SslProtocolSocketFactoryTest {
27
28     @Test
29     public void getInstanceTest(){
30         SslProtocolSocketFactory factory = SslProtocolSocketFactory.getInstance();
31         assertNotNull(factory);
32     }
33
34     @Test(expected = VnfmException.class)
35     public void getTest() throws VnfmException{
36         ProtocolSocketFactory factory =  SslProtocolSocketFactory.getInstance().get("test");
37     }
38     @Test
39     public void refreshTestException() throws VnfmException{
40         SslProtocolSocketFactory.getInstance().refresh("test");
41         assertTrue(true);
42     }
43     @Test
44     public void refreshTest() throws VnfmException{
45         SslProtocolSocketFactory.getInstance().refresh("Anonymous");
46         assertTrue(true);
47     }
48 }