1 /*******************************************************************************
2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (c) 2018 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 * ====================================================================
21 *******************************************************************************/
23 package org.onap.music.unittests.jsonobjects;
25 import static org.junit.Assert.*;
26 import java.util.HashMap;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.onap.music.datastore.jsonobjects.JsonUpdate;
32 public class JsonUpdateTest {
38 ju = new JsonUpdate();
43 public void testGetConditions() {
44 Map<String,Object> mapSo = new HashMap<>();
45 mapSo.put("key1","one");
46 mapSo.put("key2","two");
47 ju.setConditions(mapSo);
48 assertEquals("one",ju.getConditions().get("key1"));
52 public void testGetRow_specification() {
53 Map<String,Object> mapSo = new HashMap<>();
54 mapSo.put("key1","one");
55 mapSo.put("key2","two");
56 ju.setRow_specification(mapSo);
57 assertEquals("one",ju.getRow_specification().get("key1"));
61 public void testGetKeyspaceName() {
62 String keyspace = "keyspace";
63 ju.setKeyspaceName(keyspace);
64 assertEquals(keyspace,ju.getKeyspaceName());
68 public void testGetTableName() {
69 String table = "table";
70 ju.setTableName(table);
71 assertEquals(table,ju.getTableName());
75 public void testGetConsistencyInfo() {
76 Map<String, String> mapSs = new HashMap<>();
77 mapSs.put("k1", "one");
78 ju.setConsistencyInfo(mapSs);
79 assertEquals("one",ju.getConsistencyInfo().get("k1"));
83 public void testGetTtl() {
85 assertEquals("2000",ju.getTtl());
89 public void testGetTimestamp() {
90 ju.setTimestamp("20:00");
91 assertEquals("20:00",ju.getTimestamp());
96 public void testGetValues() {
97 Map<String,Object> cons = new HashMap<>();
98 cons.put("val1","one");
99 cons.put("val2","two");
101 assertEquals("one",ju.getValues().get("val1"));