2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 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 const validResponseJsonForRequestFromFetchWithHitsType1 = {
31 "max_score": 3.3899312,
34 "_index": "entitysearchindex-localhost",
35 "_type": "aaiEntities",
36 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
39 "entityType": "service-instance",
40 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
41 "edgeTagQueryEntityFieldValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
43 "searchTags": "service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
47 "_index": "entitysearchindex-localhost",
48 "_type": "aaiEntities",
49 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
52 "entityType": "service-instance",
53 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
54 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
56 "searchTags": "service-instance-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
60 "_index": "entitysearchindex-localhost",
61 "_type": "aaiEntities",
62 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
65 "entityType": "service-instance",
66 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
67 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
69 "searchTags": "service-instance-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
73 "_index": "entitysearchindex-localhost2",
74 "_type": "aaiEntities",
75 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
78 "entityType": "service-instance",
79 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
80 "edgeTagQueryEntityFieldValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
82 "searchTags": "service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
86 "_index": "entitysearchindex-localhost2",
87 "_type": "aaiEntities",
88 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
91 "entityType": "service-instance",
92 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
93 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
95 "searchTags": "service-instance-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
99 "_index": "entitysearchindex-localhost2",
100 "_type": "aaiEntities",
101 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
104 "entityType": "service-instance",
105 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
106 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
108 "searchTags": "service-instance-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
115 const validResponseJsonForRequestFromFetchWithHitsType2 = {
125 "max_score": 3.3899312,
128 "_index": "entitysearchindex-localhost",
129 "_type": "aaiEntities",
130 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
133 "entityType": "service-instance",
134 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
135 "entityPrimaryKeyValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
137 "searchTags": "hostname-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
141 "_index": "entitysearchindex-localhost",
142 "_type": "aaiEntities",
143 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
146 "entityType": "service-instance",
147 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
148 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
150 "searchTags": "hostname-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
154 "_index": "entitysearchindex-localhost",
155 "_type": "aaiEntities",
156 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
159 "entityType": "service-instance",
160 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
161 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
163 "searchTags": "hostname-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
170 const validResponseJsonForRequestFromFetchWithOutHits = {
180 "max_score": 3.3899312,
185 const networkError = {
186 "error": "Network Error"
189 const validResponseJsonForNodeSearchFromFetchWithHits = {
192 "id" : "service-instance.PRUCPEHOST0627002",
193 "itemType" : "service-instance",
194 "itemNameKey" : "service-instance.PRUCPEHOST0627002",
195 "itemNameValue" : "PRUCPEHOST0627002",
197 "resource-version" : "1467233099",
198 "service-instance-id" : "PRUCPEHOST0627002"
201 "className" : "selectedSearchedNodeClass",
203 "selfLinkResponseTimeInMs" : 131,
204 "relationshipNode" : false,
205 "searchTarget" : true,
206 "enrichableNode" : false
211 const inValidResponseJsonForNodeSearchFromFetchWithHits = {
216 const nodeSearchKeyword = 'service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
217 const nodeSearchKeywordWithOutEqualSign = 'a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
218 const multipleNodeSearchKeyword = 'service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1, service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
219 const mockRequestTimeOut = 1;
221 validResponseJsonForRequestFromFetchWithHitsType1: validResponseJsonForRequestFromFetchWithHitsType1,
222 validResponseJsonForRequestFromFetchWithHitsType2: validResponseJsonForRequestFromFetchWithHitsType2,
223 validResponseJsonForRequestFromFetchWithOutHits: validResponseJsonForRequestFromFetchWithOutHits,
224 networkError: networkError,
225 validResponseJsonForNodeSearchFromFetchWithHits: validResponseJsonForNodeSearchFromFetchWithHits,
226 inValidResponseJsonForNodeSearchFromFetchWithHits: inValidResponseJsonForNodeSearchFromFetchWithHits,
227 nodeSearchKeyword: nodeSearchKeyword,
228 nodeSearchKeywordWithOutEqualSign: nodeSearchKeywordWithOutEqualSign,
229 multipleNodeSearchKeyword: multipleNodeSearchKeyword,
230 mockRequestTimeOut: mockRequestTimeOut