2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 const validResponseJsonForRequestFromFetchWithHitsType1 = {
33 "max_score": 3.3899312,
36 "_index": "entitysearchindex-localhost",
37 "_type": "aaiEntities",
38 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
41 "entityType": "service-instance",
42 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
43 "edgeTagQueryEntityFieldValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
45 "searchTags": "service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
49 "_index": "entitysearchindex-localhost",
50 "_type": "aaiEntities",
51 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
54 "entityType": "service-instance",
55 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
56 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
58 "searchTags": "service-instance-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
62 "_index": "entitysearchindex-localhost",
63 "_type": "aaiEntities",
64 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
67 "entityType": "service-instance",
68 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
69 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
71 "searchTags": "service-instance-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
75 "_index": "entitysearchindex-localhost2",
76 "_type": "aaiEntities",
77 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
80 "entityType": "service-instance",
81 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
82 "edgeTagQueryEntityFieldValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
84 "searchTags": "service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
88 "_index": "entitysearchindex-localhost2",
89 "_type": "aaiEntities",
90 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
93 "entityType": "service-instance",
94 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
95 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
97 "searchTags": "service-instance-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
101 "_index": "entitysearchindex-localhost2",
102 "_type": "aaiEntities",
103 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
106 "entityType": "service-instance",
107 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
108 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
110 "searchTags": "service-instance-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
117 const validResponseJsonForRequestFromFetchWithHitsType2 = {
127 "max_score": 3.3899312,
130 "_index": "entitysearchindex-localhost",
131 "_type": "aaiEntities",
132 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
135 "entityType": "service-instance",
136 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
137 "entityPrimaryKeyValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
139 "searchTags": "hostname-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
143 "_index": "entitysearchindex-localhost",
144 "_type": "aaiEntities",
145 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
148 "entityType": "service-instance",
149 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
150 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
152 "searchTags": "hostname-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
156 "_index": "entitysearchindex-localhost",
157 "_type": "aaiEntities",
158 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
161 "entityType": "service-instance",
162 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
163 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
165 "searchTags": "hostname-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
172 const validResponseJsonForRequestFromFetchWithOutHits = {
182 "max_score": 3.3899312,
187 const networkError = {
188 "error": "Network Error"
191 const validResponseJsonForNodeSearchFromFetchWithHits = {
194 "id" : "service-instance.PRUCPEHOST0627002",
195 "itemType" : "service-instance",
196 "itemNameKey" : "service-instance.PRUCPEHOST0627002",
197 "itemNameValue" : "PRUCPEHOST0627002",
199 "resource-version" : "1467233099",
200 "service-instance-id" : "PRUCPEHOST0627002"
203 "className" : "selectedSearchedNodeClass",
205 "selfLinkResponseTimeInMs" : 131,
206 "relationshipNode" : false,
207 "searchTarget" : true,
208 "enrichableNode" : false
213 const inValidResponseJsonForNodeSearchFromFetchWithHits = {
218 const nodeSearchKeyword = 'service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
219 const nodeSearchKeywordWithOutEqualSign = 'a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
220 const multipleNodeSearchKeyword = 'service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1, service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
221 const mockRequestTimeOut = 1;
223 validResponseJsonForRequestFromFetchWithHitsType1: validResponseJsonForRequestFromFetchWithHitsType1,
224 validResponseJsonForRequestFromFetchWithHitsType2: validResponseJsonForRequestFromFetchWithHitsType2,
225 validResponseJsonForRequestFromFetchWithOutHits: validResponseJsonForRequestFromFetchWithOutHits,
226 networkError: networkError,
227 validResponseJsonForNodeSearchFromFetchWithHits: validResponseJsonForNodeSearchFromFetchWithHits,
228 inValidResponseJsonForNodeSearchFromFetchWithHits: inValidResponseJsonForNodeSearchFromFetchWithHits,
229 nodeSearchKeyword: nodeSearchKeyword,
230 nodeSearchKeywordWithOutEqualSign: nodeSearchKeywordWithOutEqualSign,
231 multipleNodeSearchKeyword: multipleNodeSearchKeyword,
232 mockRequestTimeOut: mockRequestTimeOut