-
Notifications
You must be signed in to change notification settings - Fork 16
/
test.http
122 lines (93 loc) · 4.42 KB
/
test.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
### 1. Login as sys admin
POST localhost:8080/api/login/v1/email
Content-Type: application/json
{
"email":"[email protected]",
"password":"JustAPasswordForDefaultSysAdmin"
}
### 2. Create database for the first tenant
POST localhost:8080/api/tenants/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiZXhwIjoxNjcyMzM5NzQxLCJ1c2VySWQiOjEsInJvbGVzIjpbIlNZU19BRE1JTiJdLCJlbWFpbCI6ImRlZmF1bHRTeXNBZG1pbkBnbWFpbC5jb20ifQ.E9e-Gga6ZMeeDRHJ1MaWhDcBpNKdNJet-LTKhHIv2PDgi2YmOwHmO-9MIfF1cJx0UyKb3YFQ-WPmmOT6WhzDWg
{
"name": "test_tenant",
"dbName": "test_tenant",
"userName": "test_tenant_userName",
"dbPassword": "test_tenant_password",
"user": {
"email": "[email protected]",
"password": "test_tenant_password"
}
}
### 3. Create a user with "ADMIN" role for first tenant
POST localhost:8080/api/users/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiZXhwIjoxNjcyMzM5NzQxLCJ1c2VySWQiOjEsInJvbGVzIjpbIlNZU19BRE1JTiJdLCJlbWFpbCI6ImRlZmF1bHRTeXNBZG1pbkBnbWFpbC5jb20ifQ.E9e-Gga6ZMeeDRHJ1MaWhDcBpNKdNJet-LTKhHIv2PDgi2YmOwHmO-9MIfF1cJx0UyKb3YFQ-WPmmOT6WhzDWg
{
"tenantId": 2,
"email": "[email protected]",
"password": "admin_password",
"roles" : ["ADMIN"]
}
### 4. Login as ADMIN of first tenant
POST localhost:8080/api/login/v1/email
Content-Type: application/json
{
"email":"[email protected]",
"password":"admin_password"
}
### 5. Create a research in first tenant
POST localhost:8080/api/researches/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0IiwiZXhwIjoxNjcyMzQxMjU2LCJ1c2VySWQiOjQsInRlbmFudElkIjoyLCJyb2xlcyI6WyJBRE1JTiJdLCJlbWFpbCI6InRlc3RfYWRtaW5AZ21haWwuY29tIn0.JVk1J0rhLHZoveeVB3Ez1oKiYBuLBjtEKMwOPJRzET9WtFQ7kOkAuNZAov8vW5-4ke5HbxClrm4hHBD6k6sjIA
{
"name": "Research in first tenant name",
"description": "Research in first tenant description"
}
### 6. Get list of all available researches using first tenant user
GET localhost:8080/api/researches/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0IiwiZXhwIjoxNjcyMzQxMjU2LCJ1c2VySWQiOjQsInRlbmFudElkIjoyLCJyb2xlcyI6WyJBRE1JTiJdLCJlbWFpbCI6InRlc3RfYWRtaW5AZ21haWwuY29tIn0.JVk1J0rhLHZoveeVB3Ez1oKiYBuLBjtEKMwOPJRzET9WtFQ7kOkAuNZAov8vW5-4ke5HbxClrm4hHBD6k6sjIA
### 7. Create database for second tenant
POST localhost:8080/api/tenants/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiZXhwIjoxNjcyMzM5NzQxLCJ1c2VySWQiOjEsInJvbGVzIjpbIlNZU19BRE1JTiJdLCJlbWFpbCI6ImRlZmF1bHRTeXNBZG1pbkBnbWFpbC5jb20ifQ.E9e-Gga6ZMeeDRHJ1MaWhDcBpNKdNJet-LTKhHIv2PDgi2YmOwHmO-9MIfF1cJx0UyKb3YFQ-WPmmOT6WhzDWg
{
"name": "test_tenant_2",
"dbName": "test_tenant_2",
"userName": "test_tenant_userName_2",
"dbPassword": "test_tenant_password_2",
"user": {
"email": "[email protected]",
"password": "test_tenant_password"
}
}
### 8. Create a user with "ADMIN" role for second tenant
POST localhost:8080/api/users/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiZXhwIjoxNjcyMzM5NzQxLCJ1c2VySWQiOjEsInJvbGVzIjpbIlNZU19BRE1JTiJdLCJlbWFpbCI6ImRlZmF1bHRTeXNBZG1pbkBnbWFpbC5jb20ifQ.E9e-Gga6ZMeeDRHJ1MaWhDcBpNKdNJet-LTKhHIv2PDgi2YmOwHmO-9MIfF1cJx0UyKb3YFQ-WPmmOT6WhzDWg
{
"tenantId": 3,
"email": "[email protected]",
"password": "admin_password",
"roles" : ["ADMIN"]
}
### 9. Login as ADMIN of second tenant
POST localhost:8080/api/login/v1/email
Content-Type: application/json
{
"email":"[email protected]",
"password":"admin_password"
}
### 10. Create a research in second tenant
POST localhost:8080/api/researches/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0IiwiZXhwIjoxNjcyMzQxMjU2LCJ1c2VySWQiOjQsInRlbmFudElkIjoyLCJyb2xlcyI6WyJBRE1JTiJdLCJlbWFpbCI6InRlc3RfYWRtaW5AZ21haWwuY29tIn0.JVk1J0rhLHZoveeVB3Ez1oKiYBuLBjtEKMwOPJRzET9WtFQ7kOkAuNZAov8vW5-4ke5HbxClrm4hHBD6k6sjIA
{
"name": "Research in second tenant name",
"description": "Research in second tenant description"
}
### 11. Get list of all available researches using second tenant user
GET localhost:8080/api/researches/v1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0IiwiZXhwIjoxNjcyMzQxMjU2LCJ1c2VySWQiOjQsInRlbmFudElkIjoyLCJyb2xlcyI6WyJBRE1JTiJdLCJlbWFpbCI6InRlc3RfYWRtaW5AZ21haWwuY29tIn0.JVk1J0rhLHZoveeVB3Ez1oKiYBuLBjtEKMwOPJRzET9WtFQ7kOkAuNZAov8vW5-4ke5HbxClrm4hHBD6k6sjIA