Merge "Include owner in createLockRef"
[music.git] / music-core / src / test / java / org / onap / music / unittests / jsonobjects / JsonDeleteTest.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
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
12  * 
13  *     http://www.apache.org/licenses/LICENSE-2.0
14  * 
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.
20  * 
21  * ============LICENSE_END=============================================
22  * ====================================================================
23  */
24
25 package org.onap.music.unittests.jsonobjects;
26
27 import static org.junit.Assert.*;
28 import java.util.ArrayList;
29 import java.util.HashMap;
30 import java.util.List;
31 import java.util.Map;
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.onap.music.datastore.jsonobjects.JsonDelete;
35
36 public class JsonDeleteTest {
37
38     JsonDelete jd = null;
39
40     @Before
41     public void init() {
42         jd = new JsonDelete();
43     }
44
45     @Test
46     public void testGetConditions() {
47         Map<String,Object>  mapSo = new HashMap<>();
48         mapSo.put("key1","one");
49         mapSo.put("key2","two");
50         jd.setConditions(mapSo);
51         assertEquals("one",jd.getConditions().get("key1"));
52     }
53
54     @Test
55     public void testGetConsistencyInfo() {
56         Map<String,String>  mapSs = new HashMap<>();
57         mapSs.put("key3","three");
58         mapSs.put("key4","four");
59         jd.setConsistencyInfo(mapSs);
60         assertEquals("three",jd.getConsistencyInfo().get("key3"));
61     }
62
63     @Test
64     public void testGetColumns() {
65         List<String> ary = new ArrayList<>();
66         ary.add("e1");
67         ary.add("e2");
68         ary.add("e3");
69         jd.setColumns(ary);
70         assertEquals("e1",jd.getColumns().get(0));
71     }
72
73     @Test
74     public void testGetTtl() {
75         jd.setTtl("2000");
76         assertEquals("2000",jd.getTtl());
77     }
78
79     @Test
80     public void testGetTimestamp() {
81         jd.setTimestamp("20:00");
82         assertEquals("20:00",jd.getTimestamp());
83
84     }
85
86 }