diff --git a/spec-ee/kong-api-tests/test/gateway/admin-api/licenses.spec.ts b/spec-ee/kong-api-tests/test/gateway/admin-api/licenses.spec.ts index e603ee37c2b..829cf861a83 100644 --- a/spec-ee/kong-api-tests/test/gateway/admin-api/licenses.spec.ts +++ b/spec-ee/kong-api-tests/test/gateway/admin-api/licenses.spec.ts @@ -21,6 +21,7 @@ describe('Gateway /licenses API tests', function () { const licenseKey = 'ASDASDASDASDASDASDASDASDASD_a1VASASD'; const validLicense = authDetails.license.valid; const inValidLicense = authDetails.license.invalid; + const validLicenseAws = '{vault://aws/gateway-secret-test/ee_license}' const url = `${getBasePath({ environment: isGateway() ? Environment.gateway.admin : undefined, @@ -254,6 +255,24 @@ describe('Gateway /licenses API tests', function () { ).to.include('postgres'); }); + // unskip when https://konghq.atlassian.net/browse/KAG-4341 is fixed + it.skip('should delete the license and post a new one from aws vault', async function () { + let resp = await axios({ + method: 'delete', + url: `${url}/${licenseId}`, + }); + logResponse(resp); + + expect(resp.status, 'Status should be 204').to.equal(204); + + resp = await postNegative(url, { payload: validLicenseAws }); + logResponse(resp); + expect(resp.data.message, 'Should not see license decode error').to.not.include('Unable to validate license: could not decode license json') + + licenseId = resp.data.id; + assertBasicRespDetails(resp); + }); + after(async function () { // safegurad subsequent tests from failing due to ee license by additionally posting the ee license const resp = await postNegative(url, { payload: validLicense });