@@ -299,7 +299,25 @@ describe('Endpoints', function () {
299299 expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
300300 } ) ;
301301 } ) ;
302- it ( '[Endpoint-0012] should return one entry with localadr 1.1.1.1' , async ( ) => {
302+ it ( '[Endpoint-0012] should return all entries not having a 200 status code' , async ( ) => {
303+ return await requestAsync ( {
304+ method : 'GET' ,
305+ uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=status&value=!2xx` ,
306+ headers : {
307+ 'cookie' : 'VIDUSR=Search-0011-DAVID-1597468226-Z+qdRW4rGZnwzQ==' ,
308+ 'csrf-token' : '04F9F07E59F588CDE469FC367A12ED3A4B845FDA9A9AE2D9A77686823067CDDC'
309+ } ,
310+ json : true
311+ } ) . then ( ( { response, body } ) => {
312+ expect ( response . statusCode ) . to . equal ( 200 ) ;
313+ expect ( body ) . to . be . an ( 'Object' ) ;
314+ expect ( body ) . to . have . property ( 'data' ) ;
315+ expect ( body . data ) . to . have . lengthOf ( 1 ) ;
316+ expect ( body . data [ 0 ] . status ) . to . equals ( 404 ) ;
317+ expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
318+ } ) ;
319+ } ) ;
320+ it ( '[Endpoint-0013] should return one entry with localadr 1.1.1.1' , async ( ) => {
303321 return await requestAsync ( {
304322 method : 'GET' ,
305323 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=localAddr&value=1.1.1.1` ,
@@ -317,7 +335,7 @@ describe('Endpoints', function () {
317335 expect ( body . data [ 0 ] . uri ) . to . equals ( '/healthcheck' ) ;
318336 } ) ;
319337 } ) ;
320- it ( '[Endpoint-0013 ] should return one entry with remoteName (remoteHost) TestHost' , async ( ) => {
338+ it ( '[Endpoint-0014 ] should return one entry with remoteName (remoteHost) TestHost' , async ( ) => {
321339 return await requestAsync ( {
322340 method : 'GET' ,
323341 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=remoteName&value=TestHost` ,
@@ -335,7 +353,7 @@ describe('Endpoints', function () {
335353 expect ( body . data [ 0 ] . uri ) . to . equals ( '/healthcheck' ) ;
336354 } ) ;
337355 } ) ;
338- it ( '[Endpoint-0014 ] should return one entry with remotePort 59641' , async ( ) => {
356+ it ( '[Endpoint-0015 ] should return one entry with remotePort 59641' , async ( ) => {
339357 return await requestAsync ( {
340358 method : 'GET' ,
341359 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=remotePort&value=59641` ,
@@ -353,7 +371,7 @@ describe('Endpoints', function () {
353371 expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
354372 } ) ;
355373 } ) ;
356- it ( '[Endpoint-0015 ] should return one entry with service name Petstore HTTP' , async ( ) => {
374+ it ( '[Endpoint-0016 ] should return one entry with service name Petstore HTTP' , async ( ) => {
357375 return await requestAsync ( {
358376 method : 'GET' ,
359377 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=serviceName&value=Petstore%20HTTP` ,
@@ -372,7 +390,7 @@ describe('Endpoints', function () {
372390 expect ( body . data [ 1 ] . uri ) . to . equals ( '/petstore/v2/pet/findByStatus' ) ;
373391 } ) ;
374392 } ) ;
375- it ( '[Endpoint-0016 ] should return one entry WAF-Status 1' , async ( ) => {
393+ it ( '[Endpoint-0017 ] should return one entry WAF-Status 1' , async ( ) => {
376394 return await requestAsync ( {
377395 method : 'GET' ,
378396 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=wafStatus&value=1` ,
@@ -390,7 +408,7 @@ describe('Endpoints', function () {
390408 expect ( body . data [ 0 ] . uri ) . to . equals ( '/favicon.ico' ) ;
391409 } ) ;
392410 } ) ;
393- it ( '[Endpoint-0017 ] should return one entry with the given correlation id' , async ( ) => {
411+ it ( '[Endpoint-0018 ] should return one entry with the given correlation id' , async ( ) => {
394412 return await requestAsync ( {
395413 method : 'GET' ,
396414 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=correlationId&value=682c0f5fbe23dc8e1d80efe2` ,
@@ -408,7 +426,7 @@ describe('Endpoints', function () {
408426 expect ( body . data [ 0 ] . serviceName ) . to . equals ( 'Petstore' ) ;
409427 } ) ;
410428 } ) ;
411- it ( '[Endpoint-0018 ] should return one entry with final status Error' , async ( ) => {
429+ it ( '[Endpoint-0019 ] should return one entry with final status Error' , async ( ) => {
412430 return await requestAsync ( {
413431 method : 'GET' ,
414432 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=finalStatus&value=Error` ,
@@ -425,7 +443,7 @@ describe('Endpoints', function () {
425443 expect ( body . data [ 0 ] . uri ) . to . equals ( '/healthcheck' ) ;
426444 } ) ;
427445 } ) ;
428- it ( '[Endpoint-0019 ] should return results with a wildcard path.' , async ( ) => {
446+ it ( '[Endpoint-0020 ] should return results with a wildcard path.' , async ( ) => {
429447 return await requestAsync ( {
430448 method : 'GET' ,
431449 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=uri&value=%2Fv2%2Fpet` ,
@@ -443,7 +461,7 @@ describe('Endpoints', function () {
443461 expect ( body . data [ 1 ] . uri ) . to . equals ( '/petstore/v2/pet/findByStatus' ) ;
444462 } ) ;
445463 } ) ;
446- it ( '[Endpoint-0020 ] Should return 1 entry in the last 10 minutes (ago=10m)' , async ( ) => {
464+ it ( '[Endpoint-0021 ] Should return 1 entry in the last 10 minutes (ago=10m)' , async ( ) => {
447465 return await requestAsync ( {
448466 method : 'GET' ,
449467 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?ago=10m` ,
@@ -460,7 +478,7 @@ describe('Endpoints', function () {
460478 expect ( body . data [ 0 ] . uri ) . to . equals ( '/petstore/v2/pet/findByTag' ) ;
461479 } ) ;
462480 } ) ;
463- it ( '[Endpoint-0021 ] Should return 2 entries in the last 30 minutes (ago=30m)' , async ( ) => {
481+ it ( '[Endpoint-0022 ] Should return 2 entries in the last 30 minutes (ago=30m)' , async ( ) => {
464482 return await requestAsync ( {
465483 method : 'GET' ,
466484 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?ago=30m` ,
@@ -477,7 +495,7 @@ describe('Endpoints', function () {
477495 expect ( body . data [ 0 ] . uri ) . to . equals ( '/petstore/v2/pet/findByTag' ) ;
478496 } ) ;
479497 } ) ;
480- it ( '[Endpoint-0022 ] Should return 4 entries in the last 2 hours (ago=120h)' , async ( ) => {
498+ it ( '[Endpoint-0023 ] Should return 4 entries in the last 2 hours (ago=120h)' , async ( ) => {
481499 return await requestAsync ( {
482500 method : 'GET' ,
483501 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?ago=2h` ,
@@ -494,7 +512,7 @@ describe('Endpoints', function () {
494512 expect ( body . data [ 0 ] . uri ) . to . equals ( '/petstore/v2/pet/findByTag' ) ;
495513 } ) ;
496514 } ) ;
497- it ( '[Endpoint-0023 ] Should include the V-Host value' , async ( ) => {
515+ it ( '[Endpoint-0024 ] Should include the V-Host value' , async ( ) => {
498516 return await requestAsync ( {
499517 method : 'GET' ,
500518 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=correlationId&value=7a240f5f0e21555d2d343482` ,
@@ -509,7 +527,7 @@ describe('Endpoints', function () {
509527 expect ( body . data [ 0 ] . vhost ) . to . equal ( 'api.customer.com:443' , 'V-Host is not part of the result' ) ;
510528 } ) ;
511529 } ) ;
512- it ( '[Endpoint-0024 ] Should not return anything when using the wrong request protocol.' , async ( ) => {
530+ it ( '[Endpoint-0025 ] Should not return anything when using the wrong request protocol.' , async ( ) => {
513531 return await requestAsync ( {
514532 method : 'GET' ,
515533 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?protocol=filetransfer` ,
@@ -525,7 +543,7 @@ describe('Endpoints', function () {
525543 expect ( body . data ) . to . have . lengthOf ( 0 ) ;
526544 } ) ;
527545 } ) ;
528- it ( '[Endpoint-0025 ] Should return the OPTIONS request including the URI' , async ( ) => {
546+ it ( '[Endpoint-0026 ] Should return the OPTIONS request including the URI' , async ( ) => {
529547 return await requestAsync ( {
530548 method : 'GET' ,
531549 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-2/ops/search?protocol=http&field=method&value=OPTIONS` ,
@@ -544,7 +562,7 @@ describe('Endpoints', function () {
544562 } ) ;
545563
546564 // See issue #52
547- it ( '[Endpoint-0026 ] With query on v2/pet/findByTag should return only ONE API.' , async ( ) => {
565+ it ( '[Endpoint-0027 ] With query on v2/pet/findByTag should return only ONE API.' , async ( ) => {
548566 return await requestAsync ( {
549567 method : 'GET' ,
550568 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` ,
@@ -563,7 +581,7 @@ describe('Endpoints', function () {
563581 } ) ;
564582 } ) ;
565583
566- it ( '[Endpoint-0027 ] Should ignore the region if null' , async ( ) => {
584+ it ( '[Endpoint-0028 ] Should ignore the region if null' , async ( ) => {
567585 return await requestAsync ( {
568586 method : 'GET' ,
569587 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` ,
@@ -583,7 +601,7 @@ describe('Endpoints', function () {
583601 } ) ;
584602 // For any reason, this test-case sometimes returns a result and sometimes not
585603 //
586- it . skip ( '[Endpoint-0028 ] should return one entry with localport 8080 and a part of the original subject ID' , async ( ) => {
604+ it . skip ( '[Endpoint-0029 ] should return one entry with localport 8080 and a part of the original subject ID' , async ( ) => {
587605 return await requestAsync ( {
588606 method : 'GET' ,
589607 uri : `http://localhost:${ server . apibuilder . port } /api/elk/v1/api/router/service/instance-1/ops/search?field=localPort&value=8080&field=subject&value=Chris` ,
0 commit comments