Merge "Add INFO.yaml file"
[music.git] / src / test / java / org / onap / music / unittests / jsonobjects / JsonTableTest.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
4  * ===================================================================
5  *  Copyright (c) 2017 AT&T Intellectual Property
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  * 
19  * ============LICENSE_END=============================================
20  * ====================================================================
21  */
22
23 package org.onap.music.unittests.jsonobjects;
24
25 import static org.junit.Assert.*;
26 import java.util.HashMap;
27 import java.util.Map;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.onap.music.datastore.jsonobjects.JsonTable;
31
32 public class JsonTableTest {
33
34     JsonTable jt = null;
35     
36     @Before
37     public void init() {
38         jt = new JsonTable();
39     }
40     
41     @Test
42     public void testGetConsistencyInfo() {
43         Map<String, String> mapSs = new HashMap<>();
44         mapSs.put("k1", "one");
45         jt.setConsistencyInfo(mapSs);
46         assertEquals("one",jt.getConsistencyInfo().get("k1"));
47     }
48
49     @Test
50     public void testGetProperties() {
51         Map<String, Object> properties = new HashMap<>();
52         properties.put("k1", "one");
53         jt.setProperties(properties);
54     }
55
56     @Test
57     public void testGetFields() {
58         Map<String, String> fields = new HashMap<>();
59         fields.put("k1", "one");
60         jt.setFields(fields);
61         assertEquals("one",jt.getFields().get("k1"));
62     }
63
64     @Test
65     public void testGetKeyspaceName() {
66         String keyspace = "keyspace";
67         jt.setKeyspaceName(keyspace);
68         assertEquals(keyspace,jt.getKeyspaceName());
69     }
70
71     @Test
72     public void testGetTableName() {
73         String table = "table";
74         jt.setTableName(table);
75         assertEquals(table,jt.getTableName());
76    }
77
78     @Test
79     public void testGetSortingKey() {
80         String sortKey = "sortkey";
81         jt.setSortingKey(sortKey);
82         assertEquals(sortKey,jt.getSortingKey());
83     }
84
85     @Test
86     public void testGetClusteringOrder() {
87         String clusteringOrder = "clusteringOrder";
88         jt.setClusteringOrder(clusteringOrder);
89         assertEquals(clusteringOrder,jt.getClusteringOrder());
90     }
91
92     @Test
93     public void testGetPrimaryKey() {
94         String primaryKey = "primaryKey";
95         jt.setPrimaryKey(primaryKey);
96         assertEquals(primaryKey,jt.getPrimaryKey());        
97     }
98
99 }