Skip to content

Commit b342972

Browse files
committed
TASK: Updating RAML types, Postman and OAS definition
1 parent 9695138 commit b342972

29 files changed

+1941
-814
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
meta {
2+
name: SetUnitType
3+
type: http
4+
seq: 758
5+
}
6+
7+
post {
8+
url: {{apiUrl}}/{{project-key}}/as-associate/{{associate-id}}/business-units/{{business-unit-id}}
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"version": {{business-unit-version}},
16+
"actions": [
17+
{
18+
"action" : "setUnitType",
19+
"unitType" : "Division",
20+
"parentUnit" : {
21+
"typeId" : "business-unit",
22+
"key" : "commercetools"
23+
}
24+
}
25+
]
26+
}
27+
}
28+
29+
query {
30+
~expand:
31+
}
32+
33+
script:post-response {
34+
var data = res.body;
35+
if(res.status == 200 || res.status == 201) {
36+
if(data.results && data.results[0] && data.results[0].id && data.results[0].version){
37+
bru.setEnvVar("business-unit-id", data.results[0].id);
38+
bru.setEnvVar("business-unit-version", data.results[0].version);
39+
}
40+
if(data.results && data.results[0] && data.results[0].key){
41+
bru.setEnvVar("business-unit-key", data.results[0].key);
42+
}
43+
if(data.version){
44+
bru.setEnvVar("business-unit-version", data.version);
45+
}
46+
if(data.id){
47+
bru.setEnvVar("business-unit-id", data.id);
48+
}
49+
if(data.key){
50+
bru.setEnvVar("business-unit-key", data.key);
51+
}
52+
53+
}
54+
}
55+
56+
assert {
57+
res.status: in [200, 201]
58+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
meta {
2+
name: SetUnitType
3+
type: http
4+
seq: 758
5+
}
6+
7+
post {
8+
url: {{apiUrl}}/{{project-key}}/business-units/{{business-unit-id}}
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"version": {{business-unit-version}},
16+
"actions": [
17+
{
18+
"action" : "setUnitType",
19+
"unitType" : "Division",
20+
"parentUnit" : {
21+
"typeId" : "business-unit",
22+
"key" : "commercetools"
23+
}
24+
}
25+
]
26+
}
27+
}
28+
29+
query {
30+
~expand:
31+
}
32+
33+
script:post-response {
34+
var data = res.body;
35+
if(res.status == 200 || res.status == 201) {
36+
if(data.results && data.results[0] && data.results[0].id && data.results[0].version){
37+
bru.setEnvVar("business-unit-id", data.results[0].id);
38+
bru.setEnvVar("business-unit-version", data.results[0].version);
39+
}
40+
if(data.results && data.results[0] && data.results[0].key){
41+
bru.setEnvVar("business-unit-key", data.results[0].key);
42+
}
43+
if(data.version){
44+
bru.setEnvVar("business-unit-version", data.version);
45+
}
46+
if(data.id){
47+
bru.setEnvVar("business-unit-id", data.id);
48+
}
49+
if(data.key){
50+
bru.setEnvVar("business-unit-key", data.key);
51+
}
52+
53+
}
54+
}
55+
56+
assert {
57+
res.status: in [200, 201]
58+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
meta {
2+
name: SetUnitType
3+
type: http
4+
seq: 758
5+
}
6+
7+
post {
8+
url: {{apiUrl}}/{{project-key}}/in-store/key={{store-key}}/business-units/{{business-unit-id}}
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"version": {{business-unit-version}},
16+
"actions": [
17+
{
18+
"action" : "setUnitType",
19+
"unitType" : "Division",
20+
"parentUnit" : {
21+
"typeId" : "business-unit",
22+
"key" : "commercetools"
23+
}
24+
}
25+
]
26+
}
27+
}
28+
29+
query {
30+
~expand:
31+
}
32+
33+
script:post-response {
34+
var data = res.body;
35+
if(res.status == 200 || res.status == 201) {
36+
if(data.results && data.results[0] && data.results[0].id && data.results[0].version){
37+
bru.setEnvVar("business-unit-id", data.results[0].id);
38+
bru.setEnvVar("business-unit-version", data.results[0].version);
39+
}
40+
if(data.results && data.results[0] && data.results[0].key){
41+
bru.setEnvVar("business-unit-key", data.results[0].key);
42+
}
43+
if(data.version){
44+
bru.setEnvVar("business-unit-version", data.version);
45+
}
46+
if(data.id){
47+
bru.setEnvVar("business-unit-id", data.id);
48+
}
49+
if(data.key){
50+
bru.setEnvVar("business-unit-key", data.key);
51+
}
52+
53+
}
54+
}
55+
56+
assert {
57+
res.status: in [200, 201]
58+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
meta {
2+
name: SetUnitType
3+
type: http
4+
seq: 758
5+
}
6+
7+
post {
8+
url: {{apiUrl}}/{{project-key}}/me/business-units/{{business-unit-id}}
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"version": {{business-unit-version}},
16+
"actions": [
17+
{
18+
"action" : "setUnitType",
19+
"unitType" : "Division",
20+
"parentUnit" : {
21+
"typeId" : "business-unit",
22+
"key" : "commercetools"
23+
}
24+
}
25+
]
26+
}
27+
}
28+
29+
query {
30+
~expand:
31+
}
32+
33+
script:post-response {
34+
var data = res.body;
35+
if(res.status == 200 || res.status == 201) {
36+
if(data.results && data.results[0] && data.results[0].id && data.results[0].version){
37+
bru.setEnvVar("business-unit-id", data.results[0].id);
38+
bru.setEnvVar("business-unit-version", data.results[0].version);
39+
}
40+
if(data.results && data.results[0] && data.results[0].key){
41+
bru.setEnvVar("business-unit-key", data.results[0].key);
42+
}
43+
if(data.version){
44+
bru.setEnvVar("business-unit-version", data.version);
45+
}
46+
if(data.id){
47+
bru.setEnvVar("business-unit-id", data.id);
48+
}
49+
if(data.key){
50+
bru.setEnvVar("business-unit-key", data.key);
51+
}
52+
53+
}
54+
}
55+
56+
assert {
57+
res.status: in [200, 201]
58+
}

0 commit comments

Comments
 (0)