@@ -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 ( `should reject body-supplied tower hostname` , async function ( ) {
97- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
97+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
9898 const res = await request ( 'POST' , '/ansibletower' , {
9999 towerHost : TOWER_HOST + ansiblePaths [ 0 ] ,
100100 token : '12345' ,
@@ -103,7 +103,7 @@ describe(`ansibletower Route`, function () {
103103 } )
104104
105105 it ( `should fail closed when caller cannot read the credential secret` , async function ( ) {
106- nock ( process . env . CLUSTER_API_URL ) . get ( '/apis ' ) . reply ( 200 )
106+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api ' ) . reply ( 200 )
107107 nock ( process . env . CLUSTER_API_URL )
108108 . get ( `/api/v1/namespaces/${ SECRET_NS } /secrets/${ SECRET_NAME } ` )
109109 . reply ( 403 , { kind : 'Status' , apiVersion : 'v1' , status : 'Failure' , reason : 'Forbidden' , code : 403 } )
@@ -116,7 +116,7 @@ describe(`ansibletower Route`, function () {
116116 } )
117117
118118 it ( `when bad things happen to Ansible Automation controller Jobs 1` , async function ( ) {
119- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 200 )
119+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 200 )
120120 nockCredentialSecret ( TOWER_HOST )
121121 nock ( TOWER_HOST ) . get ( ansiblePaths [ 0 ] ) . reply ( 200 , response )
122122 const res = await request ( 'POST' , '/ansibletower' , {
@@ -129,7 +129,7 @@ describe(`ansibletower Route`, function () {
129129 } )
130130
131131 it ( `when bad things happen to Ansible Automation controller Jobs 2` , async function ( ) {
132- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 200 )
132+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 200 )
133133 nockCredentialSecret ( TOWER_HOST )
134134 nock ( TOWER_HOST ) . get ( ansiblePaths [ 0 ] ) . reply ( 200 , response )
135135 const res = await request ( 'POST' , '/ansibletower' , {
@@ -141,7 +141,7 @@ describe(`ansibletower Route`, function () {
141141 } )
142142
143143 it ( `when bad things happen to Ansible Automation controller Jobs 3` , async function ( ) {
144- nock ( process . env . CLUSTER_API_URL ) . head ( '/api' ) . reply ( 401 )
144+ nock ( process . env . CLUSTER_API_URL ) . get ( '/api' ) . reply ( 401 )
145145 const res = await request ( 'POST' , '/ansibletower' )
146146 expect ( res . statusCode ) . toEqual ( 401 )
147147 expect ( JSON . stringify ( await parsePipedJsonBody ( res ) ) ) . toEqual ( JSON . stringify ( { } ) )
0 commit comments