abe31a3591d9570fee264306797bf8452b34baeb
[aai/sparky-be.git] / src / test / java / org / onap / aai / sparky / common / search / CommonSearchSuggestionTest.java
1 package org.onap.aai.sparky.common.search;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertNull;
6
7 import java.util.ArrayList;
8
9 import org.junit.Before;
10 import org.junit.Test;
11 import org.onap.aai.sparky.search.filters.entity.UiFilterValueEntity;
12
13
14 public class CommonSearchSuggestionTest {
15         
16         private CommonSearchSuggestion commonSearchSuggestions;
17         private CommonSearchSuggestion commonSearchSuggestion;
18         private ArrayList<UiFilterValueEntity> filterValues; 
19         
20         @Before
21           public void init() throws Exception {
22                 
23                 filterValues = new ArrayList<UiFilterValueEntity>();
24                 commonSearchSuggestions = new CommonSearchSuggestion("627dfa28b","schema","generic-vnf called sdwanfwdemo_vnf1_under_fw-si1","VNF-Stack",filterValues);
25                 commonSearchSuggestion = new CommonSearchSuggestion("627dfa28b","schema","generic-vnf called sdwanfwdemo_vnf1_under_fw-si1","VNF-Stack",null);
26               
27           }
28         
29         
30         @Test 
31         public void updateValues() {
32                 
33                 commonSearchSuggestions.setHashId("4a83c197ffa19ec4a1");
34                 assertNotNull(commonSearchSuggestions.getHashId());
35                 commonSearchSuggestions.setRoute("structuredView");
36                 assertNotNull(commonSearchSuggestions.getRoute());
37                 commonSearchSuggestions.setText("generic-vnf called fp_vnf1_under_fw-si1 called fp_vnf1_under_fw-si1 -- Schema");
38                 assertNotNull(commonSearchSuggestions.getText());
39                 assertNotNull(commonSearchSuggestions.getFilterValues());
40                 assertNotNull(commonSearchSuggestions.toString());
41         
42                 
43                 commonSearchSuggestion.setHashId(null);
44                 assertNull(commonSearchSuggestion.getHashId());
45                 commonSearchSuggestion.setRoute(null);
46                 assertNull(commonSearchSuggestion.getRoute());
47                 commonSearchSuggestion.setText(null);
48                 assertNull(commonSearchSuggestion.getText());
49                 assertNull(commonSearchSuggestion.getFilterValues());
50                 assertNotNull(commonSearchSuggestion.toString());
51                 
52         }
53         
54
55 }