69403cc7d02f83ded8349cd76d0f8fd47bb22883
[music.git] / src / test / java / org / onap / music / unittests / jsonobjects / JsonInsertTest.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.Test;
29 import org.onap.music.datastore.jsonobjects.JsonInsert;
30
31 public class JsonInsertTest {
32     
33     JsonInsert ji = new JsonInsert();
34
35     @Test
36     public void testGetKeyspaceName() {
37         ji.setKeyspaceName("keyspace");
38         assertEquals("keyspace",ji.getKeyspaceName());
39     }
40
41     @Test
42     public void testGetTableName() {
43         ji.setTableName("table");
44         assertEquals("table",ji.getTableName());
45     }
46
47     @Test
48     public void testGetConsistencyInfo() {
49         Map<String,String> cons = new HashMap<>();
50         cons.put("test","true");
51         ji.setConsistencyInfo(cons);
52         assertEquals("true",ji.getConsistencyInfo().get("test"));
53     }
54
55     @Test
56     public void testGetTtl() {
57         ji.setTtl("ttl");
58         assertEquals("ttl",ji.getTtl());
59     }
60
61     @Test
62     public void testGetTimestamp() {
63         ji.setTimestamp("10:30");
64         assertEquals("10:30",ji.getTimestamp());
65     }
66
67     @Test
68     public void testGetValues() {
69         Map<String,Object> cons = new HashMap<>();
70         cons.put("val1","one");
71         cons.put("val2","two");
72         ji.setValues(cons);
73         assertEquals("one",ji.getValues().get("val1"));
74     }
75
76     @Test
77     public void testGetRow_specification() {
78         Map<String,Object> cons = new HashMap<>();
79         cons.put("val1","one");
80         cons.put("val2","two");
81         ji.setRow_specification(cons);
82         assertEquals("two",ji.getRow_specification().get("val2"));
83     }
84
85
86 }