1 package org.onap.aai.sparky.common.search;
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertNull;
7 import java.util.ArrayList;
9 import org.junit.Before;
10 import org.junit.Test;
11 import org.onap.aai.sparky.search.filters.entity.UiFilterValueEntity;
14 public class CommonSearchSuggestionTest {
16 private CommonSearchSuggestion commonSearchSuggestions;
17 private CommonSearchSuggestion commonSearchSuggestion;
18 private ArrayList<UiFilterValueEntity> filterValues;
21 public void init() throws Exception {
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);
31 public void updateValues() {
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());
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());