2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (c) 2017 AT&T Intellectual Property
6 * ===================================================================
7 * Modifications Copyright (c) 2019 Samsung
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * ============LICENSE_END=============================================
22 * ====================================================================
25 package org.onap.music.datastore.jsonobjects;
27 import static org.junit.Assert.*;
28 import java.util.ArrayList;
29 import java.util.HashMap;
30 import java.util.List;
32 import org.junit.Before;
33 import org.junit.Test;
35 public class JsonDeleteTest {
41 jd = new JsonDelete();
45 public void testGetConditions() {
46 Map<String,Object> mapSo = new HashMap<>();
47 mapSo.put("key1","one");
48 mapSo.put("key2","two");
49 jd.setConditions(mapSo);
50 assertEquals("one",jd.getConditions().get("key1"));
54 public void testGetConsistencyInfo() {
55 Map<String,String> mapSs = new HashMap<>();
56 mapSs.put("key3","three");
57 mapSs.put("key4","four");
58 jd.setConsistencyInfo(mapSs);
59 assertEquals("three",jd.getConsistencyInfo().get("key3"));
63 public void testGetColumns() {
64 List<String> ary = new ArrayList<>();
69 assertEquals("e1",jd.getColumns().get(0));
73 public void testGetTtl() {
75 assertEquals("2000",jd.getTtl());
79 public void testGetTimestamp() {
80 jd.setTimestamp("20:00");
81 assertEquals("20:00",jd.getTimestamp());
86 public void testGetKeyspaceName() {
87 jd.setKeyspaceName("keyspace");
88 assertEquals("keyspace",jd.getKeyspaceName());
93 public void testGetTableName() {
94 jd.setTableName("tablename");
95 assertEquals("tablename",jd.getTableName());
100 public void testGetPrimarKeyValue() {
101 jd.setPrimarKeyValue("primarykey");
102 assertEquals("primarykey",jd.getPrimarKeyValue());
107 public void testRowIdString() {
108 StringBuilder builder = new StringBuilder("testing");
109 jd.setRowIdString(builder);
110 assertEquals(jd.getRowIdString().toString(),builder.toString());