2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.instar.interfaceImpl;
27 import java.util.ArrayList;
28 import java.util.List;
29 import org.junit.Test;
30 import org.openecomp.sdnc.config.params.data.Parameter;
31 import org.openecomp.sdnc.config.params.data.ResponseKey;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
34 public class TestInterfaceIpAddressImpl {
36 @Test(expected=Exception.class)
37 public void testProcessRuleException1() throws Exception{
38 Parameter param = new Parameter();
39 param.setRuleType("test");
40 param.setName("test");
41 param.setSource("INSTAR");
42 SvcLogicContext svc = new SvcLogicContext();
43 svc.setAttribute("vnf-name", "test");
44 InterfaceIpAddressImpl impl = new InterfaceIpAddressImpl(param,svc);
48 @Test(expected=Exception.class)
49 public void testProcessRuleException2() throws Exception{
50 List<ResponseKey> list = new ArrayList<>();
51 list.add(new ResponseKey());
52 list.add(new ResponseKey());
53 Parameter param = new Parameter();
54 param.setResponseKeys(list);
55 param.setRuleType("test");
56 param.setName("test");
57 param.setSource("INSTAR");
58 SvcLogicContext svc = new SvcLogicContext();
59 svc.setAttribute("vnf-name", "test");
60 InterfaceIpAddressImpl impl = new InterfaceIpAddressImpl(param,svc);
62 param.setSource("INSTAR1");