@@ -84,6 +84,12 @@ const wait = (ms = 5000) => {
8484 } ) ;
8585} ;
8686
87+ const get_port = ports => {
88+ const providerToBeUsed = 'DL2-TEST' ;
89+ const port = ports . find ( port => port . provider_name === providerToBeUsed ) ;
90+ return port ;
91+ } ;
92+
8793const options = {
8894 authenticator : new IamAuthenticator ( {
8995 apikey : config . IAMAPIKEY ,
@@ -368,7 +374,7 @@ describe('DirectLinkV1', () => {
368374 dlService . listPorts ( { } ) . then ( response => {
369375 expect ( response . status ) . toBe ( 200 ) ;
370376 if ( null != response && null != response . result && null != response . result . ports ) {
371- port = response . result . ports [ 0 ] ;
377+ port = get_port ( response . result . ports ) ;
372378 }
373379 done ( ) ;
374380 } ) ;
@@ -1275,7 +1281,7 @@ describe('DirectLinkV1', () => {
12751281 dlService . listPorts ( { } ) . then ( response => {
12761282 expect ( response . status ) . toBe ( 200 ) ;
12771283 if ( null != response && null != response . result && null != response . result . ports ) {
1278- port = response . result . ports [ 0 ] ;
1284+ port = get_port ( response . result . ports ) ;
12791285 }
12801286 done ( ) ;
12811287 } ) ;
@@ -1519,7 +1525,7 @@ describe('DirectLinkV1', () => {
15191525 dlService . listPorts ( { } ) . then ( response => {
15201526 expect ( response . status ) . toBe ( 200 ) ;
15211527 if ( null != response && null != response . result && null != response . result . ports ) {
1522- port = response . result . ports [ 0 ] ;
1528+ port = get_port ( response . result . ports ) ;
15231529 }
15241530 done ( ) ;
15251531 } ) ;
@@ -1814,7 +1820,7 @@ describe('DirectLinkV1', () => {
18141820 dlService . listPorts ( { } ) . then ( response => {
18151821 expect ( response . status ) . toBe ( 200 ) ;
18161822 if ( null != response && null != response . result && null != response . result . ports ) {
1817- port = response . result . ports [ 0 ] ;
1823+ port = get_port ( response . result . ports ) ;
18181824 }
18191825 done ( ) ;
18201826 } ) ;
0 commit comments