2 * ============LICENSE_START==========================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * ============LICENSE_END=============================================
20 * ====================================================================
23 package org.onap.music.unittests.jsonobjects;
25 import static org.junit.Assert.*;
26 import java.util.HashMap;
28 import org.junit.Test;
29 import org.onap.music.datastore.jsonobjects.JsonInsert;
31 public class JsonInsertTest {
33 JsonInsert ji = new JsonInsert();
36 public void testGetKeyspaceName() {
37 ji.setKeyspaceName("keyspace");
38 assertEquals("keyspace",ji.getKeyspaceName());
42 public void testGetTableName() {
43 ji.setTableName("table");
44 assertEquals("table",ji.getTableName());
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"));
56 public void testGetTtl() {
58 assertEquals("ttl",ji.getTtl());
62 public void testGetTimestamp() {
63 ji.setTimestamp("10:30");
64 assertEquals("10:30",ji.getTimestamp());
68 public void testGetValues() {
69 Map<String,Object> cons = new HashMap<>();
70 cons.put("val1","one");
71 cons.put("val2","two");
73 assertEquals("one",ji.getValues().get("val1"));
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"));