|
| 1 | +meta { |
| 2 | + name: Import import-container |
| 3 | + type: http |
| 4 | + seq: 26 |
| 5 | +} |
| 6 | + |
| 7 | +post { |
| 8 | + url: {{apiUrl}}/{{project-key}}/business-units/import-containers/{{import-container-key}} |
| 9 | + body: json |
| 10 | + auth: inherit |
| 11 | +} |
| 12 | + |
| 13 | +body:json { |
| 14 | + { |
| 15 | + "type" : "business-unit", |
| 16 | + "resources" : [ { |
| 17 | + "key" : "acme-business-unit", |
| 18 | + "name" : "ACME Business Unit", |
| 19 | + "unitType" : "Company" |
| 20 | + }, { |
| 21 | + "key" : "acme-business-unit-division-a", |
| 22 | + "name" : "ACME Business Unit: Division A", |
| 23 | + "unitType" : "Division", |
| 24 | + "parentUnit" : { |
| 25 | + "key" : "acme-business-unit", |
| 26 | + "typeId" : "business-unit" |
| 27 | + } |
| 28 | + } ] |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +query { |
| 33 | +} |
| 34 | + |
| 35 | +script:post-response { |
| 36 | + var data = res.body; |
| 37 | + if(res.status == 200 || res.status == 201) { |
| 38 | + if(data.results && data.results[0] && data.results[0].id && data.results[0].version){ |
| 39 | + bru.setEnvVar("import-container-id", data.results[0].id); |
| 40 | + bru.setEnvVar("import-container-version", data.results[0].version); |
| 41 | + } |
| 42 | + if(data.results && data.results[0] && data.results[0].key){ |
| 43 | + bru.setEnvVar("import-container-key", data.results[0].key); |
| 44 | + } |
| 45 | + if(data.version){ |
| 46 | + bru.setEnvVar("import-container-version", data.version); |
| 47 | + } |
| 48 | + if(data.id){ |
| 49 | + bru.setEnvVar("import-container-id", data.id); |
| 50 | + } |
| 51 | + if(data.key){ |
| 52 | + bru.setEnvVar("import-container-key", data.key); |
| 53 | + } |
| 54 | + |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +assert { |
| 59 | + res.status: in [200, 201] |
| 60 | +} |
0 commit comments