2 * ============LICENSE_START=======================================================
3 * SPARKY (AAI UI service)
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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 * ============LICENSE_END=========================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 const validResponseJsonForRequestFromFetchWithHitsType1 = {
36 "max_score": 3.3899312,
39 "_index": "entitysearchindex-localhost",
40 "_type": "aaiEntities",
41 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
44 "entityType": "service-instance",
45 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
46 "edgeTagQueryEntityFieldValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
48 "searchTags": "service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
52 "_index": "entitysearchindex-localhost",
53 "_type": "aaiEntities",
54 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
57 "entityType": "service-instance",
58 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
59 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
61 "searchTags": "service-instance-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
65 "_index": "entitysearchindex-localhost",
66 "_type": "aaiEntities",
67 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
70 "entityType": "service-instance",
71 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
72 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
74 "searchTags": "service-instance-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
78 "_index": "entitysearchindex-localhost2",
79 "_type": "aaiEntities",
80 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
83 "entityType": "service-instance",
84 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
85 "edgeTagQueryEntityFieldValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
87 "searchTags": "service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
91 "_index": "entitysearchindex-localhost2",
92 "_type": "aaiEntities",
93 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
96 "entityType": "service-instance",
97 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
98 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
100 "searchTags": "service-instance-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
104 "_index": "entitysearchindex-localhost2",
105 "_type": "aaiEntities",
106 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
109 "entityType": "service-instance",
110 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
111 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
113 "searchTags": "service-instance-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
120 const validResponseJsonForRequestFromFetchWithHitsType2 = {
130 "max_score": 3.3899312,
133 "_index": "entitysearchindex-localhost",
134 "_type": "aaiEntities",
135 "_id": "4785c7ec8ae11be12ca742248713346ea03a473ef65aa84bbea102c67fa5d",
138 "entityType": "service-instance",
139 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
140 "entityPrimaryKeyValue": "a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1",
142 "searchTags": "hostname-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1"
146 "_index": "entitysearchindex-localhost",
147 "_type": "aaiEntities",
148 "_id": "8e9baedcbf1cb2f9439f6b8b5eeaf0b8fa364086c8ef5ee6edcf6f5da114",
151 "entityType": "service-instance",
152 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
153 "edgeTagQueryEntityFieldValue": "d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8",
155 "searchTags": "hostname-id=d1f3c3be-7a7f-42ea-a9ac-ca20af1588b8"
159 "_index": "entitysearchindex-localhost",
160 "_type": "aaiEntities",
161 "_id": "dd4bdbf810f5c1bc7be7d91f241b0221d75617a45f574f2ed6207e9c8ceb9e",
164 "entityType": "service-instance",
165 "edgeTagQueryEntityFieldName": "service-instance.service-instance-id",
166 "edgeTagQueryEntityFieldValue": "6c27a7cb-d8e1-45a8-aa12-61a694201cca",
168 "searchTags": "hostname-id=6c27a7cb-d8e1-45a8-aa12-61a694201cca"
175 const validResponseJsonForRequestFromFetchWithOutHits = {
185 "max_score": 3.3899312,
190 const networkError = {
191 "error": "Network Error"
194 const validResponseJsonForNodeSearchFromFetchWithHits = {
197 "id" : "service-instance.PRUCPEHOST0627002",
198 "itemType" : "service-instance",
199 "itemNameKey" : "service-instance.PRUCPEHOST0627002",
200 "itemNameValue" : "PRUCPEHOST0627002",
202 "resource-version" : "1467233099",
203 "service-instance-id" : "PRUCPEHOST0627002"
206 "className" : "selectedSearchedNodeClass",
208 "selfLinkResponseTimeInMs" : 131,
209 "relationshipNode" : false,
210 "searchTarget" : true,
211 "enrichableNode" : false
216 const inValidResponseJsonForNodeSearchFromFetchWithHits = {
221 const nodeSearchKeyword = 'service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
222 const nodeSearchKeywordWithOutEqualSign = 'a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
223 const multipleNodeSearchKeyword = 'service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1, service-instance-id=a162a2a2-ea7e-4e94-afc3-e9d064a3c2a1';
224 const mockRequestTimeOut = 1;
226 validResponseJsonForRequestFromFetchWithHitsType1: validResponseJsonForRequestFromFetchWithHitsType1,
227 validResponseJsonForRequestFromFetchWithHitsType2: validResponseJsonForRequestFromFetchWithHitsType2,
228 validResponseJsonForRequestFromFetchWithOutHits: validResponseJsonForRequestFromFetchWithOutHits,
229 networkError: networkError,
230 validResponseJsonForNodeSearchFromFetchWithHits: validResponseJsonForNodeSearchFromFetchWithHits,
231 inValidResponseJsonForNodeSearchFromFetchWithHits: inValidResponseJsonForNodeSearchFromFetchWithHits,
232 nodeSearchKeyword: nodeSearchKeyword,
233 nodeSearchKeywordWithOutEqualSign: nodeSearchKeywordWithOutEqualSign,
234 multipleNodeSearchKeyword: multipleNodeSearchKeyword,
235 mockRequestTimeOut: mockRequestTimeOut