Integrate aai-schema-ingest library into aai-core
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / util / genxsd / DeleteFootnoteSetTest.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T 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.onap.aai.util.genxsd;
21
22 import static org.junit.Assert.*;
23 import static org.mockito.Mockito.*;
24
25 import java.util.Arrays;
26 import java.util.Collection;
27
28 import org.mockito.runners.MockitoJUnitRunner;
29 import static org.hamcrest.MatcherAssert.assertThat;
30 import static org.hamcrest.CoreMatchers.is;
31 import org.mockito.BDDMockito;
32 import org.mockito.InjectMocks;
33 import org.hamcrest.Matcher;
34 import org.junit.runners.*;
35 import org.junit.runners.Parameterized.Parameters;
36 import org.junit.Before;
37 import org.junit.BeforeClass;
38 import org.junit.Test;
39 import org.junit.runner.RunWith;
40
41 @RunWith(Parameterized.class)
42 public class DeleteFootnoteSetTest {
43         String targetNode;
44         String flavor;
45         String result;
46         DeleteFootnoteSet footnotes = null;
47         
48         @Parameters
49         public static Collection<String[]> testConditions() {
50                 String inputs [][] = {
51                 {"vserver","(1)", "\n      -(1) IF this VSERVER node is deleted, this FROM node is DELETED also\n"},
52                 {"ctag-pool","(2)", "\n      -(2) IF this CTAG-POOL node is deleted, this TO node is DELETED also\n"},
53                 {"pserver","(3)", "\n      -(3) IF this FROM node is deleted, this PSERVER is DELETED also\n"},
54                 {"oam-network","(4)", "\n      -(4) IF this TO node is deleted, this OAM-NETWORK is DELETED also\n"},
55                 {"dvs-switch","(1)", "\n      -(1) IF this DVS-SWITCH node is deleted, this FROM node is DELETED also\n"},
56                 {"availability-zone","(3)", "\n      -(3) IF this FROM node is deleted, this AVAILABILITY-ZONE is DELETED also\n"}
57                 };
58                 return (Arrays.asList(inputs));
59         }
60         
61         public DeleteFootnoteSetTest(String targetNode, String flavor, String result) {
62                 super();
63                 this.targetNode = targetNode;
64                 this.flavor = flavor;
65                 this.result=result;
66         }
67
68         @Before
69         public void setUp() throws Exception {
70                 footnotes = new DeleteFootnoteSet(this.targetNode);
71         }
72
73         @Test
74         public void testDeleteFootnoteSet() {           
75                 assertThat(footnotes.targetNode, is(this.targetNode));
76         }
77
78         @Test
79         public void testAdd() {
80                 footnotes.add(this.flavor);
81                 assertThat(footnotes.footnotes.size(), is(1));
82         }
83
84         @Test
85         public void testToString() {
86                 footnotes.add(this.flavor);
87                 assertThat(footnotes.toString(), is(this.result));
88         }
89
90 }