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 *******************************************************************************/
22 package org.onap.music.unittests.jsonobjects;
24 import static org.junit.Assert.*;
25 import java.util.HashMap;
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.onap.music.datastore.jsonobjects.JsonUpdate;
31 public class JsonUpdateTest {
37 ju = new JsonUpdate();
42 public void testGetConditions() {
43 Map<String,Object> mapSo = new HashMap<>();
44 mapSo.put("key1","one");
45 mapSo.put("key2","two");
46 ju.setConditions(mapSo);
47 assertEquals("one",ju.getConditions().get("key1"));
51 public void testGetRow_specification() {
52 Map<String,Object> mapSo = new HashMap<>();
53 mapSo.put("key1","one");
54 mapSo.put("key2","two");
55 ju.setRow_specification(mapSo);
56 assertEquals("one",ju.getRow_specification().get("key1"));
60 public void testGetKeyspaceName() {
61 String keyspace = "keyspace";
62 ju.setKeyspaceName(keyspace);
63 assertEquals(keyspace,ju.getKeyspaceName());
67 public void testGetTableName() {
68 String table = "table";
69 ju.setTableName(table);
70 assertEquals(table,ju.getTableName());
74 public void testGetConsistencyInfo() {
75 Map<String, String> mapSs = new HashMap<>();
76 mapSs.put("k1", "one");
77 ju.setConsistencyInfo(mapSs);
78 assertEquals("one",ju.getConsistencyInfo().get("k1"));
82 public void testGetTtl() {
84 assertEquals("2000",ju.getTtl());
88 public void testGetTimestamp() {
89 ju.setTimestamp("20:00");
90 assertEquals("20:00",ju.getTimestamp());
95 public void testGetValues() {
96 Map<String,Object> cons = new HashMap<>();
97 cons.put("val1","one");
98 cons.put("val2","two");
100 assertEquals("one",ju.getValues().get("val1"));