4e3b462953f9ae4ad0532ea8f5dd22d314150db7
[music.git] / music-core / 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  *  Modifications Copyright (c) 2019 IBM.
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
12  * 
13  *     http://www.apache.org/licenses/LICENSE-2.0
14  * 
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.
20  * 
21  * ============LICENSE_END=============================================
22  * ====================================================================
23  */
24
25 package org.onap.music.unittests.jsonobjects;
26
27 import static org.junit.Assert.*;
28 import java.util.HashMap;
29 import java.util.Map;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.onap.music.datastore.jsonobjects.JsonTable;
33
34 public class JsonTableTest {
35
36     JsonTable jt = null;
37     
38     @Before
39     public void init() {
40         jt = new JsonTable();
41     }
42     
43     @Test
44     public void testGetConsistencyInfo() {
45         Map<String, String> mapSs = new HashMap<>();
46         mapSs.put("k1", "one");
47         jt.setConsistencyInfo(mapSs);
48         assertEquals("one",jt.getConsistencyInfo().get("k1"));
49     }
50
51     @Test
52     public void testGetProperties() {
53         Map<String, Object> properties = new HashMap<>();
54         properties.put("k1", "one");
55         jt.setProperties(properties);
56     }
57
58     @Test
59     public void testGetFields() {
60         Map<String, String> fields = new HashMap<>();
61         fields.put("k1", "one");
62         jt.setFields(fields);
63         assertEquals("one",jt.getFields().get("k1"));
64     }
65
66     @Test
67     public void testGetKeyspaceName() {
68         String keyspace = "keyspace";
69         jt.setKeyspaceName(keyspace);
70         assertEquals(keyspace,jt.getKeyspaceName());
71     }
72
73     @Test
74     public void testGetTableName() {
75         String table = "table";
76         jt.setTableName(table);
77         assertEquals(table,jt.getTableName());
78    }
79
80     @Test
81     public void testGetClusteringOrder() {
82         String clusteringOrder = "clusteringOrder";
83         jt.setClusteringOrder(clusteringOrder);
84         assertEquals(clusteringOrder,jt.getClusteringOrder());
85     }
86
87     @Test
88     public void testGetPrimaryKey() {
89         String primaryKey = "primaryKey";
90         jt.setPrimaryKey(primaryKey);
91         assertEquals(primaryKey,jt.getPrimaryKey());        
92     }
93     
94     @Test
95     public void testFilteringKey() {
96         jt.setFilteringKey("FilteringKey");
97         assertEquals("FilteringKey",jt.getFilteringKey());        
98     }
99
100 }