@@ -24,7 +24,7 @@ function nockCredentialSecret(host: string) {
2424
2525describe ( `ansibletower Route` , function ( ) {
2626 it ( `should list Ansible Automation controller Jobs` , async function ( ) {
27- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 200 )
27+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 200 )
2828 nockCredentialSecret ( TOWER_HOST )
2929 nock ( TOWER_HOST ) . get ( ansiblePaths [ 0 ] ) . reply ( 200 , response )
3030 const res = await request ( 'POST' , '/ansibletower' , {
@@ -37,7 +37,7 @@ describe(`ansibletower Route`, function () {
3737 } )
3838
3939 it ( `should reject body-supplied tower hostname` , async function ( ) {
40- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
40+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
4141 const res = await request ( 'POST' , '/ansibletower' , {
4242 towerHost : TOWER_HOST + ansiblePaths [ 0 ] ,
4343 token : '12345' ,
@@ -46,7 +46,7 @@ describe(`ansibletower Route`, function () {
4646 } )
4747
4848 it ( `should preserve the query string for paginated requests` , async function ( ) {
49- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
49+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
5050 nockCredentialSecret ( TOWER_HOST )
5151 nock ( TOWER_HOST ) . get ( ansiblePaths [ 0 ] ) . query ( { page : '2' , page_size : '20' } ) . reply ( 200 , response )
5252 const res = await request ( 'POST' , '/ansibletower' , {
@@ -59,7 +59,7 @@ describe(`ansibletower Route`, function () {
5959 } )
6060
6161 it ( `should reject an external absolute URL in ansiblePath` , async function ( ) {
62- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
62+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
6363 nockCredentialSecret ( TOWER_HOST )
6464 const res = await request ( 'POST' , '/ansibletower' , {
6565 secretNamespace : SECRET_NS ,
@@ -70,7 +70,7 @@ describe(`ansibletower Route`, function () {
7070 } )
7171
7272 it ( `should reject a network-path reference in ansiblePath` , async function ( ) {
73- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
73+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
7474 nockCredentialSecret ( TOWER_HOST )
7575 const res = await request ( 'POST' , '/ansibletower' , {
7676 secretNamespace : SECRET_NS ,
@@ -81,7 +81,7 @@ describe(`ansibletower Route`, function () {
8181 } )
8282
8383 it ( `should fail closed when caller cannot read the credential secret` , async function ( ) {
84- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
84+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
8585 nock ( process . env . CLUSTER_API_URL )
8686 . get ( `/api/v1/namespaces/${ SECRET_NS } /secrets/${ SECRET_NAME } ` )
8787 . reply ( 403 , { kind : 'Status' , apiVersion : 'v1' , status : 'Failure' , reason : 'Forbidden' , code : 403 } )
@@ -94,7 +94,7 @@ describe(`ansibletower Route`, function () {
9494 } )
9595
9696 it ( `when bad things happen to Ansible Automation controller Jobs 1` , async function ( ) {
97- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 200 )
97+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 200 )
9898 nockCredentialSecret ( TOWER_HOST )
9999 nock ( TOWER_HOST ) . get ( ansiblePaths [ 0 ] ) . reply ( 200 , response )
100100 const res = await request ( 'POST' , '/ansibletower' , {
@@ -107,7 +107,7 @@ describe(`ansibletower Route`, function () {
107107 } )
108108
109109 it ( `when bad things happen to Ansible Automation controller Jobs 2` , async function ( ) {
110- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 200 )
110+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 200 )
111111 nockCredentialSecret ( TOWER_HOST )
112112 nock ( TOWER_HOST ) . get ( ansiblePaths [ 0 ] ) . reply ( 200 , response )
113113 const res = await request ( 'POST' , '/ansibletower' , {
@@ -119,7 +119,7 @@ describe(`ansibletower Route`, function () {
119119 } )
120120
121121 it ( `when bad things happen to Ansible Automation controller Jobs 3` , async function ( ) {
122- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 401 )
122+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 401 )
123123 const res = await request ( 'POST' , '/ansibletower' )
124124 expect ( res . statusCode ) . toEqual ( 401 )
125125 expect ( JSON . stringify ( await parsePipedJsonBody ( res ) ) ) . toEqual ( JSON . stringify ( { } ) )
0 commit comments