Skip to content

Commit 6e43ceb

Browse files
authored
[AzureSpringCloudV0] Using PUT method when deploying custom container app (#19253)
1 parent b5b4b7d commit 6e43ceb

20 files changed

+398
-110
lines changed

Tasks/AzureSpringCloudV0/Tests/DeploymentToStagingSucceedsL0.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,49 @@ export class DeploymentToStagingSucceedsL0 {
123123
}]
124124

125125
}).persist();
126+
127+
nock('https://management.azure.com', {
128+
reqheaders: {
129+
"authorization": "Bearer DUMMY_ACCESS_TOKEN",
130+
"content-type": "application/json; charset=utf-8",
131+
"user-agent": "TFS_useragent"
132+
}
133+
}).get(`/subscriptions/${MOCK_SUBSCRIPTION_ID}/resourceGroups/${encodeURIComponent(MOCK_RESOURCE_GROUP_NAME)}/providers/${ASC_RESOURCE_TYPE}/${this.TEST_NAME}/apps/${this.MOCK_APP_NAME}/deployments/theOtherOne?api-version=${API_VERSION}`)
134+
.reply(200, {
135+
"id": `/subscriptions/${MOCK_SUBSCRIPTION_ID}/resourceGroups/${encodeURIComponent(MOCK_RESOURCE_GROUP_NAME)}/providers/${ASC_RESOURCE_TYPE}/${this.TEST_NAME}/apps/${this.MOCK_APP_NAME}/deployments/theOtherOne`,
136+
"name": "theOtherOne",
137+
"properties": {
138+
"active": false,
139+
"appName": this.MOCK_APP_NAME,
140+
"deploymentSettings": {
141+
"cpu": 1,
142+
"environmentVariables": null,
143+
"memoryInGB": 1,
144+
"runtimeVersion": "Java_8"
145+
},
146+
"instances": [
147+
{
148+
"discoveryStatus": "UP",
149+
"name": `${this.MOCK_APP_NAME}-theOtherOne-7-7b77f5b6f5-90210`,
150+
"startTime": "2021-03-13T01:39:20Z",
151+
"status": "Running"
152+
}
153+
],
154+
"provisioningState": "Succeeded",
155+
"source": {
156+
"relativePath": "<default>",
157+
"type": "Jar"
158+
},
159+
"status": "Running"
160+
},
161+
"resourceGroup": MOCK_RESOURCE_GROUP_NAME,
162+
"sku": {
163+
"capacity": 1,
164+
"name": "S0",
165+
"tier": "Standard"
166+
},
167+
"type": `${ASC_RESOURCE_TYPE}/apps/deployments`
168+
}).persist();
126169
}
127170

128171
/** Simulate APIs invoked as part of deployment */

Tasks/AzureSpringCloudV0/Tests/DeploymentToStagingSucceedsWithBuildServiceL0.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,49 @@ export class DeploymentToStagingSucceedsWithBuildServiceL0 {
123123
}]
124124

125125
}).persist();
126+
127+
nock('https://management.azure.com', {
128+
reqheaders: {
129+
"authorization": "Bearer DUMMY_ACCESS_TOKEN",
130+
"content-type": "application/json; charset=utf-8",
131+
"user-agent": "TFS_useragent"
132+
}
133+
}).get(`/subscriptions/${MOCK_SUBSCRIPTION_ID}/resourceGroups/${encodeURIComponent(MOCK_RESOURCE_GROUP_NAME)}/providers/${ASC_RESOURCE_TYPE}/${this.TEST_NAME}/apps/${this.MOCK_APP_NAME}/deployments/theOtherOne?api-version=${API_VERSION}`)
134+
.reply(200, {
135+
"id": `/subscriptions/${MOCK_SUBSCRIPTION_ID}/resourceGroups/${encodeURIComponent(MOCK_RESOURCE_GROUP_NAME)}/providers/${ASC_RESOURCE_TYPE}/${this.TEST_NAME}/apps/${this.MOCK_APP_NAME}/deployments/theOtherOne`,
136+
"name": "theOtherOne",
137+
"properties": {
138+
"active": false,
139+
"appName": this.MOCK_APP_NAME,
140+
"deploymentSettings": {
141+
"cpu": 1,
142+
"environmentVariables": null,
143+
"memoryInGB": 1,
144+
"runtimeVersion": "Java_8"
145+
},
146+
"instances": [
147+
{
148+
"discoveryStatus": "UP",
149+
"name": `${this.MOCK_APP_NAME}-theOtherOne-7-7b77f5b6f5-90210`,
150+
"startTime": "2021-03-13T01:39:20Z",
151+
"status": "Running"
152+
}
153+
],
154+
"provisioningState": "Succeeded",
155+
"source": {
156+
"relativePath": "<default>",
157+
"type": "Jar"
158+
},
159+
"status": "Running"
160+
},
161+
"resourceGroup": MOCK_RESOURCE_GROUP_NAME,
162+
"sku": {
163+
"capacity": 1,
164+
"name": "S0",
165+
"tier": "Standard"
166+
},
167+
"type": `${ASC_RESOURCE_TYPE}/apps/deployments`
168+
}).persist();
126169
}
127170

128171
/**

Tasks/AzureSpringCloudV0/_buildConfigs/Node20/Tests/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)