@@ -51,8 +51,8 @@ describe('Endpoints', function () {
51
51
*/
52
52
after ( ( ) => stopApiBuilder ( server ) ) ;
53
53
54
- describe ( 'Search' , ( ) => {
55
- it ( '[Search-0001] Execute a search without a limit including all requests from instance-1' , ( ) => {
54
+ describe ( 'Search' , async ( ) => {
55
+ it ( '[Search-0001] Execute a search without a limit including all requests from instance-1' , async ( ) => {
56
56
return await requestAsync ( {
57
57
method : 'GET' ,
58
58
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search` ,
@@ -74,7 +74,7 @@ describe('Endpoints', function () {
74
74
} ) ;
75
75
} ) ;
76
76
77
- it ( '[Endpoint-0002] should return with one result for instance-2' , ( ) => {
77
+ it ( '[Endpoint-0002] should return with one result for instance-2' , async ( ) => {
78
78
const auth = {
79
79
user : server . apibuilder . config . apikey || 'test' ,
80
80
password : ''
@@ -96,7 +96,7 @@ describe('Endpoints', function () {
96
96
} ) ;
97
97
} ) ;
98
98
99
- it ( '[Endpoint-0003] should restrict based on the URI and HTTP Verb' , ( ) => {
99
+ it ( '[Endpoint-0003] should restrict based on the URI and HTTP Verb' , async ( ) => {
100
100
const auth = {
101
101
user : server . apibuilder . config . apikey || 'test' ,
102
102
password : ''
@@ -119,7 +119,7 @@ describe('Endpoints', function () {
119
119
checkFields ( body . data , true ) ;
120
120
} ) ;
121
121
} ) ;
122
- it ( '[Endpoint-0004] should return 1 entry based on duration filter' , ( ) => {
122
+ it ( '[Endpoint-0004] should return 1 entry based on duration filter' , async ( ) => {
123
123
const auth = {
124
124
user : server . apibuilder . config . apikey || 'test' ,
125
125
password : ''
@@ -140,7 +140,7 @@ describe('Endpoints', function () {
140
140
checkFields ( body . data , true ) ;
141
141
} ) ;
142
142
} ) ;
143
- it ( '[Endpoint-0005] should return 1 entry based on operation filter' , ( ) => {
143
+ it ( '[Endpoint-0005] should return 1 entry based on operation filter' , async ( ) => {
144
144
const auth = {
145
145
user : server . apibuilder . config . apikey || 'test' ,
146
146
password : ''
@@ -162,7 +162,7 @@ describe('Endpoints', function () {
162
162
checkFields ( body . data , true ) ;
163
163
} ) ;
164
164
} ) ;
165
- it ( '[Endpoint-0006] should return 0 entries as all test data is in the past' , ( ) => {
165
+ it ( '[Endpoint-0006] should return 0 entries as all test data is in the past' , async ( ) => {
166
166
const auth = {
167
167
user : server . apibuilder . config . apikey || 'test' ,
168
168
password : ''
@@ -182,7 +182,7 @@ describe('Endpoints', function () {
182
182
expect ( body . data ) . to . have . lengthOf ( 0 ) ;
183
183
} ) ;
184
184
} ) ;
185
- it ( '[Endpoint-0007] should return 2 when using a custom time-range' , ( ) => {
185
+ it ( '[Endpoint-0007] should return 2 when using a custom time-range' , async ( ) => {
186
186
//
187
187
/**
188
188
* The dates given here must be aligned with dates in search_test_documents.js. Currently configured like so:
@@ -212,7 +212,7 @@ describe('Endpoints', function () {
212
212
expect ( body . data [ 1 ] . correlationId ) . to . equal ( "19250f5f4321b5ba2a4de364" ) ;
213
213
} ) ;
214
214
} ) ;
215
- it ( '[Endpoint-0008] should return 3 when using a wider custom time-range' , ( ) => {
215
+ it ( '[Endpoint-0008] should return 3 when using a wider custom time-range' , async ( ) => {
216
216
//
217
217
/**
218
218
* The dates given here must be aligned with dates in search_test_documents.js. Currently configured like so:
@@ -245,7 +245,7 @@ describe('Endpoints', function () {
245
245
expect ( body . data [ 3 ] . correlationId ) . to . equal ( "19250f5f4321b5ba2a4de364" ) ;
246
246
} ) ;
247
247
} ) ;
248
- it ( '[Endpoint-0009] should return two entries with localport 8080' , ( ) => {
248
+ it ( '[Endpoint-0009] should return two entries with localport 8080' , async ( ) => {
249
249
return await requestAsync ( {
250
250
method : 'GET' ,
251
251
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=localPort&value=8080` ,
@@ -263,7 +263,7 @@ describe('Endpoints', function () {
263
263
} ) ;
264
264
} ) ;
265
265
266
- it ( '[Endpoint-0010A] should return one entry with localport 8080 and given subject-id' , ( ) => {
266
+ it ( '[Endpoint-0010A] should return one entry with localport 8080 and given subject-id' , async ( ) => {
267
267
return await requestAsync ( {
268
268
method : 'GET' ,
269
269
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=localPort&value=8080&field=subject&value=Chris-Test` ,
@@ -281,7 +281,7 @@ describe('Endpoints', function () {
281
281
expect ( body . data [ 0 ] . subject ) . to . equals ( 'Chris-Test' ) ;
282
282
} ) ;
283
283
} ) ;
284
- it ( '[Endpoint-0010B] should return one entry with localport 8080 and a part of the original subject ID' , ( ) => {
284
+ it ( '[Endpoint-0010B] should return one entry with localport 8080 and a part of the original subject ID' , async ( ) => {
285
285
return await requestAsync ( {
286
286
method : 'GET' ,
287
287
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=localPort&value=8080&field=subject&value=Chris` ,
@@ -299,7 +299,7 @@ describe('Endpoints', function () {
299
299
expect ( body . data [ 0 ] . subject ) . to . equals ( 'Chris-Test' ) ;
300
300
} ) ;
301
301
} ) ;
302
- it ( '[Endpoint-0011] should return one entry with localport 8080 and given subject-id' , ( ) => {
302
+ it ( '[Endpoint-0011] should return one entry with localport 8080 and given subject-id' , async ( ) => {
303
303
return await requestAsync ( {
304
304
method : 'GET' ,
305
305
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=status&value=404` ,
@@ -317,7 +317,7 @@ describe('Endpoints', function () {
317
317
expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
318
318
} ) ;
319
319
} ) ;
320
- it ( '[Endpoint-0012] should return one entry with localadr 1.1.1.1' , ( ) => {
320
+ it ( '[Endpoint-0012] should return one entry with localadr 1.1.1.1' , async ( ) => {
321
321
return await requestAsync ( {
322
322
method : 'GET' ,
323
323
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=localAddr&value=1.1.1.1` ,
@@ -335,7 +335,7 @@ describe('Endpoints', function () {
335
335
expect ( body . data [ 0 ] . uri ) . to . equals ( '/healthcheck' ) ;
336
336
} ) ;
337
337
} ) ;
338
- it ( '[Endpoint-0013] should return one entry with remoteName (remoteHost) TestHost' , ( ) => {
338
+ it ( '[Endpoint-0013] should return one entry with remoteName (remoteHost) TestHost' , async ( ) => {
339
339
return await requestAsync ( {
340
340
method : 'GET' ,
341
341
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=remoteName&value=TestHost` ,
@@ -353,7 +353,7 @@ describe('Endpoints', function () {
353
353
expect ( body . data [ 0 ] . uri ) . to . equals ( '/healthcheck' ) ;
354
354
} ) ;
355
355
} ) ;
356
- it ( '[Endpoint-0014] should return one entry with remotePort 59641' , ( ) => {
356
+ it ( '[Endpoint-0014] should return one entry with remotePort 59641' , async ( ) => {
357
357
return await requestAsync ( {
358
358
method : 'GET' ,
359
359
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=remotePort&value=59641` ,
@@ -371,7 +371,7 @@ describe('Endpoints', function () {
371
371
expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
372
372
} ) ;
373
373
} ) ;
374
- it ( '[Endpoint-0015] should return one entry with service name Petstore HTTP' , ( ) => {
374
+ it ( '[Endpoint-0015] should return one entry with service name Petstore HTTP' , async ( ) => {
375
375
return await requestAsync ( {
376
376
method : 'GET' ,
377
377
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=serviceName&value=Petstore%20HTTP` ,
@@ -390,7 +390,7 @@ describe('Endpoints', function () {
390
390
expect ( body . data [ 1 ] . uri ) . to . equals ( '/petstore/v2/pet/findByStatus' ) ;
391
391
} ) ;
392
392
} ) ;
393
- it ( '[Endpoint-0016] should return one entry WAF-Status 1' , ( ) => {
393
+ it ( '[Endpoint-0016] should return one entry WAF-Status 1' , async ( ) => {
394
394
return await requestAsync ( {
395
395
method : 'GET' ,
396
396
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=wafStatus&value=1` ,
@@ -408,7 +408,7 @@ describe('Endpoints', function () {
408
408
expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
409
409
} ) ;
410
410
} ) ;
411
- it ( '[Endpoint-0017] should return one entry with the given correlation id' , ( ) => {
411
+ it ( '[Endpoint-0017] should return one entry with the given correlation id' , async ( ) => {
412
412
return await requestAsync ( {
413
413
method : 'GET' ,
414
414
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=correlationId&value=682c0f5fbe23dc8e1d80efe2` ,
@@ -426,7 +426,7 @@ describe('Endpoints', function () {
426
426
expect ( body . data [ 0 ] . serviceName ) . to . equals ( 'Petstore' ) ;
427
427
} ) ;
428
428
} ) ;
429
- it ( '[Endpoint-0018] should return one entry with final status Error' , ( ) => {
429
+ it ( '[Endpoint-0018] should return one entry with final status Error' , async ( ) => {
430
430
return await requestAsync ( {
431
431
method : 'GET' ,
432
432
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=finalStatus&value=Error` ,
@@ -443,7 +443,7 @@ describe('Endpoints', function () {
443
443
expect ( body . data [ 0 ] . uri ) . to . equals ( '/healthcheck' ) ;
444
444
} ) ;
445
445
} ) ;
446
- it ( '[Endpoint-0019] should return results with a wildcard path.' , ( ) => {
446
+ it ( '[Endpoint-0019] should return results with a wildcard path.' , async ( ) => {
447
447
return await requestAsync ( {
448
448
method : 'GET' ,
449
449
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=uri&value=%2Fv2%2Fpet` ,
@@ -461,7 +461,7 @@ describe('Endpoints', function () {
461
461
expect ( body . data [ 1 ] . uri ) . to . equals ( '/petstore/v2/pet/findByStatus' ) ;
462
462
} ) ;
463
463
} ) ;
464
- it ( '[Endpoint-0020] Should return 1 entry in the last 10 minutes (ago=10m)' , ( ) => {
464
+ it ( '[Endpoint-0020] Should return 1 entry in the last 10 minutes (ago=10m)' , async ( ) => {
465
465
return await requestAsync ( {
466
466
method : 'GET' ,
467
467
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?ago=10m` ,
@@ -478,7 +478,7 @@ describe('Endpoints', function () {
478
478
expect ( body . data [ 0 ] . uri ) . to . equals ( '/petstore/v2/pet/findByTag' ) ;
479
479
} ) ;
480
480
} ) ;
481
- it ( '[Endpoint-0021] Should return 2 entries in the last 30 minutes (ago=30m)' , ( ) => {
481
+ it ( '[Endpoint-0021] Should return 2 entries in the last 30 minutes (ago=30m)' , async ( ) => {
482
482
return await requestAsync ( {
483
483
method : 'GET' ,
484
484
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?ago=30m` ,
@@ -495,7 +495,7 @@ describe('Endpoints', function () {
495
495
expect ( body . data [ 0 ] . uri ) . to . equals ( '/petstore/v2/pet/findByTag' ) ;
496
496
} ) ;
497
497
} ) ;
498
- it ( '[Endpoint-0022] Should return 4 entries in the last 2 hours (ago=120h)' , ( ) => {
498
+ it ( '[Endpoint-0022] Should return 4 entries in the last 2 hours (ago=120h)' , async ( ) => {
499
499
return await requestAsync ( {
500
500
method : 'GET' ,
501
501
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?ago=2h` ,
@@ -512,7 +512,7 @@ describe('Endpoints', function () {
512
512
expect ( body . data [ 0 ] . uri ) . to . equals ( '/petstore/v2/pet/findByTag' ) ;
513
513
} ) ;
514
514
} ) ;
515
- it ( '[Endpoint-0023] Should include the V-Host value' , ( ) => {
515
+ it ( '[Endpoint-0023] Should include the V-Host value' , async ( ) => {
516
516
return await requestAsync ( {
517
517
method : 'GET' ,
518
518
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=correlationId&value=7a240f5f0e21555d2d343482` ,
@@ -527,7 +527,7 @@ describe('Endpoints', function () {
527
527
expect ( body . data [ 0 ] . vhost ) . to . equal ( 'api.customer.com:443' , 'V-Host is not part of the result' ) ;
528
528
} ) ;
529
529
} ) ;
530
- it ( '[Endpoint-0024] Should not return anything when using the wrong request protocol.' , ( ) => {
530
+ it ( '[Endpoint-0024] Should not return anything when using the wrong request protocol.' , async ( ) => {
531
531
return await requestAsync ( {
532
532
method : 'GET' ,
533
533
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?protocol=filetransfer` ,
@@ -543,7 +543,7 @@ describe('Endpoints', function () {
543
543
expect ( body . data ) . to . have . lengthOf ( 0 ) ;
544
544
} ) ;
545
545
} ) ;
546
- it ( '[Endpoint-0025] Should return the OPTIONS request including the URI' , ( ) => {
546
+ it ( '[Endpoint-0025] Should return the OPTIONS request including the URI' , async ( ) => {
547
547
return await requestAsync ( {
548
548
method : 'GET' ,
549
549
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-2/ops/search?protocol=http&field=method&value=OPTIONS` ,
@@ -562,7 +562,7 @@ describe('Endpoints', function () {
562
562
} ) ;
563
563
564
564
// See issue #52
565
- it ( '[Endpoint-0026] With query on v2/pet/findByTag should return only ONE API.' , ( ) => {
565
+ it ( '[Endpoint-0026] With query on v2/pet/findByTag should return only ONE API.' , async ( ) => {
566
566
return await requestAsync ( {
567
567
method : 'GET' ,
568
568
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=uri&value=%2Fpetstore%2Fv2%2Fpet%2FfindByTag&field=method&value=GET` ,
@@ -581,7 +581,7 @@ describe('Endpoints', function () {
581
581
} ) ;
582
582
} ) ;
583
583
584
- it ( '[Endpoint-0027] Should ignore the region if null' , ( ) => {
584
+ it ( '[Endpoint-0027] Should ignore the region if null' , async ( ) => {
585
585
return await requestAsync ( {
586
586
method : 'GET' ,
587
587
uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=uri&value=%2Fpetstore%2Fv2%2Fpet%2FfindByTag&field=method&value=GET` ,
0 commit comments