diff --git a/src/cliOptions.js b/src/cliOptions.js index 0b0dd61..ee2020d 100644 --- a/src/cliOptions.js +++ b/src/cliOptions.js @@ -241,7 +241,7 @@ const APP_CLI_OPTIONS = Object.freeze({ optionalFlagArgs: [FLAG_ARG.SKIP_UNCHANGED], callback: reg.registryUpdateAllDependencies, }, - REGISTRY_UPDATE_APPURL: { + REGISTRY_UPDATE_APP_URL: { commandVariants: ["--registry-update-url"], optionalPassArgs: [PASS_ARG.TENANT_ID], callback: reg.registryUpdateApplicationURL, diff --git a/src/shared/static.js b/src/shared/static.js index f77acdc..1a4705a 100644 --- a/src/shared/static.js +++ b/src/shared/static.js @@ -297,7 +297,7 @@ const limiter = async (limit, payloads, iterator) => { return results.map(({ value }) => value); }; -const CHARPOINTS = Object.freeze({ +const CHAR_POINTS = Object.freeze({ // 33 -- 47 are 15 symbols // 58 -- 64 are 7 symbols again // 91 -- 96 are 6 symbols again @@ -321,10 +321,10 @@ const randomString = ( { doNumbers = true, doUpperCaseLetters = true, doLowerCaseLetters = true, doSymbols = false } = {} ) => { const alphabet = [].concat( - doNumbers ? CHARPOINTS.NUMBERS : [], - doUpperCaseLetters ? CHARPOINTS.UPPER_CASE_LETTERS : [], - doLowerCaseLetters ? CHARPOINTS.LOWER_CASE_LETTERS : [], - doSymbols ? CHARPOINTS.SYMBOLS : [] + doNumbers ? CHAR_POINTS.NUMBERS : [], + doUpperCaseLetters ? CHAR_POINTS.UPPER_CASE_LETTERS : [], + doLowerCaseLetters ? CHAR_POINTS.LOWER_CASE_LETTERS : [], + doSymbols ? CHAR_POINTS.SYMBOLS : [] ); return alphabet.length === 0 ? [] diff --git a/src/submodules/tenantRegistry.js b/src/submodules/tenantRegistry.js index be95ee7..9b69911 100644 --- a/src/submodules/tenantRegistry.js +++ b/src/submodules/tenantRegistry.js @@ -21,10 +21,11 @@ const { assert } = require("../shared/error"); const { request } = require("../shared/request"); const REGISTRY_PAGE_SIZE = 200; -const REGISTRY_JOB_POLL_FREQUENCY = 20000; +const REGISTRY_JOB_POLL_FREQUENCY = 15000; const REGISTRY_REQUEST_CONCURRENCY_FALLBACK = 10; const TENANT_UPDATABLE_STATES = ["SUBSCRIBED", "UPDATE_FAILED"]; -const RESPONSE_STATE = Object.freeze({ +const JOB_STATE = Object.freeze({ + STARTED: "STARTED", SUCCEEDED: "SUCCEEDED", FAILED: "FAILED", }); @@ -59,6 +60,7 @@ const _registrySubscriptionsPaged = async (context, tenant) => { ...query, page: page++, }, + headers: { Accept: "application/json" }, auth: { token }, }); const { subscriptions: pageSubscriptions, morePages } = await response.json(); @@ -126,23 +128,24 @@ const _registryJobPoll = async (context, location, { skipFirst = false } = {}) = const response = await request({ url: saas_registry_url, pathname: location, + headers: { Accept: "application/json" }, auth: { token }, }); const responseBody = await response.json(); const { state } = responseBody; - if (!state || state === RESPONSE_STATE.SUCCEEDED || state === RESPONSE_STATE.FAILED) { - return JSON.stringify(responseBody, null, 2); + assert(state, "got job poll response without state\n%j", responseBody); + if (state !== JOB_STATE.STARTED) { + return responseBody; } } }; const registryJob = async (context, [jobId]) => { assert(isUUID(jobId), "JOB_ID is not a uuid", jobId); - return _registryJobPoll(context, `/api/v2.0/jobs/${jobId}`, { skipFirst: true }); + const result = await _registryJobPoll(context, `/api/v2.0/jobs/${jobId}`, { skipFirst: true }); + return JSON.stringify(result, null, 2); }; -// https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/4a8b63678cf24d5b8b36bd1957391ce3.html -// https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/9c4f927011db4bd0a53b23a1b33b36d0.html const _registryCallForTenant = async ( context, subscription, @@ -183,69 +186,64 @@ const _registryCallForTenant = async ( }); if (!doJobPoll) { - const state = response.status === 200 ? RESPONSE_STATE.SUCCEEDED : RESPONSE_STATE.FAILED; - console.log("subscription operation with method %s for tenant %s finished with state %s", method, tenantId, state); - return JSON.stringify({ tenantId, state }, null, 2); + // NOTE: with checkStatus being true by default, the above request only returns for successful changes + return { tenantId, state: JOB_STATE.SUCCEEDED }; } const [location] = response.headers.raw().location; const responseText = await response.text(); console.log("response: %s", responseText); console.log("polling job %s with interval %isec", location, REGISTRY_JOB_POLL_FREQUENCY / 1000); - return _registryJobPoll(context, location); + const jobResult = await _registryJobPoll(context, location); + + return { tenantId, jobId: jobResult.id, state: jobResult.state }; }; const _registryCallForTenants = async (context, method, options = {}) => { const { subscriptions } = await _registrySubscriptionsPaged(context); const updatableSubscriptions = subscriptions.filter(({ state }) => TENANT_UPDATABLE_STATES.includes(state)); - const result = await limiter( + return await limiter( regRequestConcurrency, updatableSubscriptions, async (subscription) => await _registryCallForTenant(context, subscription, method, options) ); - return result; -}; - -const registryUpdateDependencies = async (context, [tenantId], [doSkipUnchanged]) => { - assert(isUUID(tenantId), "TENANT_ID is not a uuid", tenantId); - const { subscriptions } = await _registrySubscriptionsPaged(context, tenantId); - return await _registryCallForTenant(context, subscriptions[0], "PATCH", { - skipUnchangedDependencies: doSkipUnchanged, - }); }; -const registryUpdateAllDependencies = async (context, _, [doSkipUnchanged]) => - await _registryCallForTenants(context, "PATCH", { skipUnchangedDependencies: doSkipUnchanged }); - -const registryUpdateApplicationURL = async (context, [tenantId]) => { +const _registryCall = async (context, method, tenantId, options) => { + let results; if (tenantId) { assert(isUUID(tenantId), "TENANT_ID is not a uuid", tenantId); const { subscriptions } = await _registrySubscriptionsPaged(context, tenantId); - return await _registryCallForTenant(context, subscriptions[0], "PATCH", { - updateApplicationURL: true, - skipUpdatingDependencies: true, - doJobPoll: false, - }); + assert(subscriptions.length >= 1, "could not find tenant %s", tenantId); + results = [await _registryCallForTenant(context, subscriptions[0], method, options)]; } else { - return await _registryCallForTenants(context, "PATCH", { - updateApplicationURL: true, - skipUpdatingDependencies: true, - doJobPoll: false, - }); + results = await _registryCallForTenants(context, method, options); } + assert(Array.isArray(results), "got invalid results from registry %s call with %j", method, options); + console.log(JSON.stringify(results.length === 1 ? results[0] : results, null, 2)); + assert( + results.every(({ state }) => state === JOB_STATE.SUCCEEDED), + "registry %s failed for some tenant", + method + ); }; -const registryOffboardSubscription = async (context, [tenantId]) => { - assert(isUUID(tenantId), "TENANT_ID is not a uuid", tenantId); - const { subscriptions } = await _registrySubscriptionsPaged(context, tenantId); - return await _registryCallForTenant(context, subscriptions[0], "DELETE"); -}; +const registryUpdateDependencies = async (context, [tenantId], [doSkipUnchanged]) => + await _registryCall(context, "PATCH", tenantId, { skipUnchangedDependencies: doSkipUnchanged }); -const registryOffboardSubscriptionSkip = async (context, [tenantId, skipApps]) => { - assert(isUUID(tenantId), "TENANT_ID is not a uuid", tenantId); - const { subscriptions } = await _registrySubscriptionsPaged(context, tenantId); - return await _registryCallForTenant(context, subscriptions[0], "DELETE", { noCallbacksAppNames: skipApps }); -}; +const registryUpdateAllDependencies = async (context, _, [doSkipUnchanged]) => + await _registryCall(context, "PATCH", undefined, { skipUnchangedDependencies: doSkipUnchanged }); + +const registryUpdateApplicationURL = async (context, [tenantId]) => + await _registryCall(context, "PATCH", tenantId, { + updateApplicationURL: true, + skipUpdatingDependencies: true, + doJobPoll: false, + }); +const registryOffboardSubscription = async (context, [tenantId]) => await _registryCall(context, "DELETE", tenantId); + +const registryOffboardSubscriptionSkip = async (context, [tenantId, skipApps]) => + await _registryCall(context, "DELETE", tenantId, { noCallbacksAppNames: skipApps }); module.exports = { registryListSubscriptions, diff --git a/test/__snapshots__/tenantRegistry.test.js.snap b/test/__snapshots__/tenantRegistry.test.js.snap index 3e09b99..52327fc 100644 --- a/test/__snapshots__/tenantRegistry.test.js.snap +++ b/test/__snapshots__/tenantRegistry.test.js.snap @@ -7,6 +7,9 @@ exports[`reg tests reg list paging 1`] = ` "auth": { "token": "token", }, + "headers": { + "Accept": "application/json", + }, "pathname": "/saas-manager/v1/plan/subscriptions", "query": { "appName": "appName", @@ -21,6 +24,9 @@ exports[`reg tests reg list paging 1`] = ` "auth": { "token": "token", }, + "headers": { + "Accept": "application/json", + }, "pathname": "/saas-manager/v1/plan/subscriptions", "query": { "appName": "appName", diff --git a/test/tenantRegistry.nock.test.js b/test/tenantRegistry.nock.test.js index 6286297..89ef1e2 100644 --- a/test/tenantRegistry.nock.test.js +++ b/test/tenantRegistry.nock.test.js @@ -170,16 +170,16 @@ describe("reg tests", () => { test("reg update tenant", async () => { const { nockDone } = await nockBack("reg-update-tenant.json", { afterRecord: anonymizeNock }); - expect(await reg.registryUpdateDependencies(await freshContext(), [testTenantId], [false])).toMatchInlineSnapshot(` - "{ - "id": "4520b25d-29fc-4bbd-9403-4a76acebbfcd", - "state": "SUCCEEDED" - }" - `); + expect(await reg.registryUpdateDependencies(await freshContext(), [testTenantId], [false])).toBeUndefined(); expect(outputFromLoggerPartitionFetch(loggerSpy.info.mock.calls)).toMatchInlineSnapshot(` "targeting cf api https://api.cf.sap.hana.ondemand.com / org "skyfin" / space "dev" response: Job for update subscription of application: afc-dev and tenant: 5ecc7413-2b7e-414a-9496-ad4a61f6cccf, was created - polling job /api/v2.0/jobs/4520b25d-29fc-4bbd-9403-4a76acebbfcd with interval 20sec + polling job /api/v2.0/jobs/4520b25d-29fc-4bbd-9403-4a76acebbfcd with interval 15sec + { + "tenantId": "5ecc7413-2b7e-414a-9496-ad4a61f6cccf", + "jobId": "4520b25d-29fc-4bbd-9403-4a76acebbfcd", + "state": "SUCCEEDED" + } GET https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/subscriptions?appName=afc-dev&tenantId=5ecc7413-2b7e-414a-9496-ad4a61f6cccf&size=200&page=1 200 OK (88ms) PATCH https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/tenants/5ecc7413-2b7e-414a-9496-ad4a61f6cccf/subscriptions 202 Accepted (88ms) @@ -193,72 +193,81 @@ describe("reg tests", () => { test("reg update tenant all", async () => { const { nockDone } = await nockBack("reg-update-tenant-all.json", { afterRecord: anonymizeNock }); - expect(await reg.registryUpdateAllDependencies(await freshContext(), undefined, [false])).toMatchInlineSnapshot(` - [ - "{ - "id": "a6334e8e-6b69-46c6-97cc-94a02c4965e5", - "state": "SUCCEEDED" - }", - "{ - "id": "eba2a96a-3de7-4f75-a3cf-af6821d0c826", - "state": "SUCCEEDED" - }", - "{ - "id": "ef9575a0-d3f9-4347-b792-24d60756bcdc", - "state": "SUCCEEDED" - }", - "{ - "id": "cf60da54-382d-48dd-bd5a-0e4eae14ceb7", - "state": "SUCCEEDED" - }", - "{ - "id": "17889327-5c21-4056-8d7c-ac75ede93088", - "state": "SUCCEEDED" - }", - "{ - "id": "a8d43a70-80f4-4ed5-bf1f-0cb6b9e51463", - "state": "SUCCEEDED" - }", - "{ - "id": "bb2c6cc7-6432-4def-b2fa-e97375268e00", - "state": "SUCCEEDED" - }", - "{ - "id": "d47be903-50f9-425b-94e1-b464d987087f", - "state": "SUCCEEDED" - }", - "{ - "id": "cd27bfbc-3f18-4297-a24c-cbc92035b80d", - "state": "SUCCEEDED" - }", - "{ - "id": "78ff106a-3a26-4246-a4db-6da81cecc0fa", - "state": "SUCCEEDED" - }", - ] - `); + expect(await reg.registryUpdateAllDependencies(await freshContext(), undefined, [false])).toBeUndefined(); expect(outputFromLoggerPartitionFetch(loggerSpy.info.mock.calls)).toMatchInlineSnapshot(` "targeting cf api https://api.cf.sap.hana.ondemand.com / org "skyfin" / space "dev" response: Job for update subscription of application: afc-dev and tenant: 5ecc7413-2b7e-414a-9496-ad4a61f6cccf, was created - polling job /api/v2.0/jobs/a6334e8e-6b69-46c6-97cc-94a02c4965e5 with interval 20sec + polling job /api/v2.0/jobs/a6334e8e-6b69-46c6-97cc-94a02c4965e5 with interval 15sec response: Job for update subscription of application: afc-dev and tenant: 6917dfd6-7590-4033-af2a-140b75263b0d, was created - polling job /api/v2.0/jobs/eba2a96a-3de7-4f75-a3cf-af6821d0c826 with interval 20sec + polling job /api/v2.0/jobs/eba2a96a-3de7-4f75-a3cf-af6821d0c826 with interval 15sec response: Job for update subscription of application: afc-dev and tenant: cb9158ce-f8fd-441b-b443-17219e8f79fa, was created - polling job /api/v2.0/jobs/ef9575a0-d3f9-4347-b792-24d60756bcdc with interval 20sec + polling job /api/v2.0/jobs/ef9575a0-d3f9-4347-b792-24d60756bcdc with interval 15sec response: Job for update subscription of application: afc-dev and tenant: 848a0f14-792d-4bd2-821c-7c6280780ca3, was created - polling job /api/v2.0/jobs/cf60da54-382d-48dd-bd5a-0e4eae14ceb7 with interval 20sec + polling job /api/v2.0/jobs/cf60da54-382d-48dd-bd5a-0e4eae14ceb7 with interval 15sec response: Job for update subscription of application: afc-dev and tenant: 4c0909b1-a84e-4763-a26e-532fdb9e40fa, was created - polling job /api/v2.0/jobs/17889327-5c21-4056-8d7c-ac75ede93088 with interval 20sec + polling job /api/v2.0/jobs/17889327-5c21-4056-8d7c-ac75ede93088 with interval 15sec response: Job for update subscription of application: afc-dev and tenant: 288393a7-972c-4fa8-acfd-12299c4db374, was created - polling job /api/v2.0/jobs/a8d43a70-80f4-4ed5-bf1f-0cb6b9e51463 with interval 20sec + polling job /api/v2.0/jobs/a8d43a70-80f4-4ed5-bf1f-0cb6b9e51463 with interval 15sec response: Job for update subscription of application: afc-dev and tenant: dde70ec5-983d-4848-b50c-fb2cdac7d359, was created - polling job /api/v2.0/jobs/bb2c6cc7-6432-4def-b2fa-e97375268e00 with interval 20sec + polling job /api/v2.0/jobs/bb2c6cc7-6432-4def-b2fa-e97375268e00 with interval 15sec response: Job for update subscription of application: afc-dev and tenant: cf528063-6a43-4bf2-8ccc-ca4e6d75d88e, was created - polling job /api/v2.0/jobs/d47be903-50f9-425b-94e1-b464d987087f with interval 20sec + polling job /api/v2.0/jobs/d47be903-50f9-425b-94e1-b464d987087f with interval 15sec response: Job for update subscription of application: afc-dev and tenant: 6ef2372b-d256-4fef-8b01-6eeb18f2eefe, was created - polling job /api/v2.0/jobs/cd27bfbc-3f18-4297-a24c-cbc92035b80d with interval 20sec + polling job /api/v2.0/jobs/cd27bfbc-3f18-4297-a24c-cbc92035b80d with interval 15sec response: Job for update subscription of application: afc-dev and tenant: 34d6259c-41bc-4f6b-8220-018ace187813, was created - polling job /api/v2.0/jobs/78ff106a-3a26-4246-a4db-6da81cecc0fa with interval 20sec + polling job /api/v2.0/jobs/78ff106a-3a26-4246-a4db-6da81cecc0fa with interval 15sec + [ + { + "tenantId": "5ecc7413-2b7e-414a-9496-ad4a61f6cccf", + "jobId": "a6334e8e-6b69-46c6-97cc-94a02c4965e5", + "state": "SUCCEEDED" + }, + { + "tenantId": "6917dfd6-7590-4033-af2a-140b75263b0d", + "jobId": "eba2a96a-3de7-4f75-a3cf-af6821d0c826", + "state": "SUCCEEDED" + }, + { + "tenantId": "cb9158ce-f8fd-441b-b443-17219e8f79fa", + "jobId": "ef9575a0-d3f9-4347-b792-24d60756bcdc", + "state": "SUCCEEDED" + }, + { + "tenantId": "848a0f14-792d-4bd2-821c-7c6280780ca3", + "jobId": "cf60da54-382d-48dd-bd5a-0e4eae14ceb7", + "state": "SUCCEEDED" + }, + { + "tenantId": "4c0909b1-a84e-4763-a26e-532fdb9e40fa", + "jobId": "17889327-5c21-4056-8d7c-ac75ede93088", + "state": "SUCCEEDED" + }, + { + "tenantId": "288393a7-972c-4fa8-acfd-12299c4db374", + "jobId": "a8d43a70-80f4-4ed5-bf1f-0cb6b9e51463", + "state": "SUCCEEDED" + }, + { + "tenantId": "dde70ec5-983d-4848-b50c-fb2cdac7d359", + "jobId": "bb2c6cc7-6432-4def-b2fa-e97375268e00", + "state": "SUCCEEDED" + }, + { + "tenantId": "cf528063-6a43-4bf2-8ccc-ca4e6d75d88e", + "jobId": "d47be903-50f9-425b-94e1-b464d987087f", + "state": "SUCCEEDED" + }, + { + "tenantId": "6ef2372b-d256-4fef-8b01-6eeb18f2eefe", + "jobId": "cd27bfbc-3f18-4297-a24c-cbc92035b80d", + "state": "SUCCEEDED" + }, + { + "tenantId": "34d6259c-41bc-4f6b-8220-018ace187813", + "jobId": "78ff106a-3a26-4246-a4db-6da81cecc0fa", + "state": "SUCCEEDED" + } + ] GET https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/subscriptions?appName=afc-dev&size=200&page=1 200 OK (88ms) PATCH https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/tenants/5ecc7413-2b7e-414a-9496-ad4a61f6cccf/subscriptions 202 Accepted (88ms) @@ -298,62 +307,51 @@ describe("reg tests", () => { test("reg update tenant application url all", async () => { const { nockDone } = await nockBack("reg-update-tenant-appurl-all.json", { afterRecord: anonymizeNock }); - expect(await reg.registryUpdateApplicationURL(await freshContext(), [])).toMatchInlineSnapshot(` - [ - "{ - "tenantId": "5ecc7413-2b7e-414a-9496-ad4a61f6cccf", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "6917dfd6-7590-4033-af2a-140b75263b0d", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "cb9158ce-f8fd-441b-b443-17219e8f79fa", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "848a0f14-792d-4bd2-821c-7c6280780ca3", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "4c0909b1-a84e-4763-a26e-532fdb9e40fa", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "288393a7-972c-4fa8-acfd-12299c4db374", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "dde70ec5-983d-4848-b50c-fb2cdac7d359", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "cf528063-6a43-4bf2-8ccc-ca4e6d75d88e", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "6ef2372b-d256-4fef-8b01-6eeb18f2eefe", - "state": "SUCCEEDED" - }", - "{ - "tenantId": "34d6259c-41bc-4f6b-8220-018ace187813", - "state": "SUCCEEDED" - }", - ] - `); + expect(await reg.registryUpdateApplicationURL(await freshContext(), [])).toBeUndefined(); expect(outputFromLoggerPartitionFetch(loggerSpy.info.mock.calls)).toMatchInlineSnapshot(` "targeting cf api https://api.cf.sap.hana.ondemand.com / org "skyfin" / space "dev" - subscription operation with method PATCH for tenant 5ecc7413-2b7e-414a-9496-ad4a61f6cccf finished with state SUCCEEDED - subscription operation with method PATCH for tenant 6917dfd6-7590-4033-af2a-140b75263b0d finished with state SUCCEEDED - subscription operation with method PATCH for tenant cb9158ce-f8fd-441b-b443-17219e8f79fa finished with state SUCCEEDED - subscription operation with method PATCH for tenant 4c0909b1-a84e-4763-a26e-532fdb9e40fa finished with state SUCCEEDED - subscription operation with method PATCH for tenant 288393a7-972c-4fa8-acfd-12299c4db374 finished with state SUCCEEDED - subscription operation with method PATCH for tenant dde70ec5-983d-4848-b50c-fb2cdac7d359 finished with state SUCCEEDED - subscription operation with method PATCH for tenant cf528063-6a43-4bf2-8ccc-ca4e6d75d88e finished with state SUCCEEDED - subscription operation with method PATCH for tenant 6ef2372b-d256-4fef-8b01-6eeb18f2eefe finished with state SUCCEEDED - subscription operation with method PATCH for tenant 34d6259c-41bc-4f6b-8220-018ace187813 finished with state SUCCEEDED - subscription operation with method PATCH for tenant 848a0f14-792d-4bd2-821c-7c6280780ca3 finished with state SUCCEEDED + [ + { + "tenantId": "5ecc7413-2b7e-414a-9496-ad4a61f6cccf", + "state": "SUCCEEDED" + }, + { + "tenantId": "6917dfd6-7590-4033-af2a-140b75263b0d", + "state": "SUCCEEDED" + }, + { + "tenantId": "cb9158ce-f8fd-441b-b443-17219e8f79fa", + "state": "SUCCEEDED" + }, + { + "tenantId": "848a0f14-792d-4bd2-821c-7c6280780ca3", + "state": "SUCCEEDED" + }, + { + "tenantId": "4c0909b1-a84e-4763-a26e-532fdb9e40fa", + "state": "SUCCEEDED" + }, + { + "tenantId": "288393a7-972c-4fa8-acfd-12299c4db374", + "state": "SUCCEEDED" + }, + { + "tenantId": "dde70ec5-983d-4848-b50c-fb2cdac7d359", + "state": "SUCCEEDED" + }, + { + "tenantId": "cf528063-6a43-4bf2-8ccc-ca4e6d75d88e", + "state": "SUCCEEDED" + }, + { + "tenantId": "6ef2372b-d256-4fef-8b01-6eeb18f2eefe", + "state": "SUCCEEDED" + }, + { + "tenantId": "34d6259c-41bc-4f6b-8220-018ace187813", + "state": "SUCCEEDED" + } + ] GET https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/subscriptions?appName=afc-dev&size=200&page=1 200 OK (88ms) PATCH https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/tenants/5ecc7413-2b7e-414a-9496-ad4a61f6cccf/subscriptions?updateApplicationURL=true&skipUpdatingDependencies=true 200 OK (88ms) @@ -376,15 +374,13 @@ describe("reg tests", () => { test("reg update tenant application url with tenant", async () => { const { nockDone } = await nockBack("req-update-tenant-appurl.json", { afterRecord: anonymizeNock }); - expect(await reg.registryUpdateApplicationURL(await freshContext(), [testTenantId])).toMatchInlineSnapshot(` - "{ - "tenantId": "5ecc7413-2b7e-414a-9496-ad4a61f6cccf", - "state": "SUCCEEDED" - }" - `); + expect(await reg.registryUpdateApplicationURL(await freshContext(), [testTenantId])).toBeUndefined(); expect(outputFromLoggerPartitionFetch(loggerSpy.info.mock.calls)).toMatchInlineSnapshot(` "targeting cf api https://api.cf.sap.hana.ondemand.com / org "skyfin" / space "dev" - subscription operation with method PATCH for tenant 5ecc7413-2b7e-414a-9496-ad4a61f6cccf finished with state SUCCEEDED + { + "tenantId": "5ecc7413-2b7e-414a-9496-ad4a61f6cccf", + "state": "SUCCEEDED" + } GET https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/subscriptions?appName=afc-dev&tenantId=5ecc7413-2b7e-414a-9496-ad4a61f6cccf&size=200&page=1 200 OK (88ms) PATCH https://saas-manager.mesh.cf.sap.hana.ondemand.com/saas-manager/v1/application/tenants/5ecc7413-2b7e-414a-9496-ad4a61f6cccf/subscriptions?updateApplicationURL=true&skipUpdatingDependencies=true 200 OK (88ms)"