Update junits
[music.git] / music-core / src / test / java / org / onap / music / datastore / 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.datastore.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
35 public class JsonDeleteTest {
36
37     JsonDelete jd = null;
38
39     @Before
40     public void init() {
41         jd = new JsonDelete();
42     }
43
44     @Test
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"));
51     }
52
53     @Test
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"));
60     }
61
62     @Test
63     public void testGetColumns() {
64         List<String> ary = new ArrayList<>();
65         ary.add("e1");
66         ary.add("e2");
67         ary.add("e3");
68         jd.setColumns(ary);
69         assertEquals("e1",jd.getColumns().get(0));
70     }
71
72     @Test
73     public void testGetTtl() {
74         jd.setTtl("2000");
75         assertEquals("2000",jd.getTtl());
76     }
77
78     @Test
79     public void testGetTimestamp() {
80         jd.setTimestamp("20:00");
81         assertEquals("20:00",jd.getTimestamp());
82
83     }
84
85 }