Files
loan-pricing/test_api/test_personal_create.http
2026-02-02 15:25:38 +08:00

197 lines
6.3 KiB
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### ============================================================
###
###
### ============================================================
### ============================================================
### 1. Token
### ============================================================
POST http://localhost:8080/login/test
Content-Type: application/json
{
"username": "admin",
"password": "admin123"
}
> {%
client.test("Request executed successfully", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 200, "Response code is 200");
client.global.set("token", response.body.data.token);
});
%}
### ============================================================
### 2. -
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "TEST001",
"custName": "",
"idType": "",
"idNum": "110101199001011234",
"guarType": "",
"applyAmt": "500000",
"bizProof": "true",
"loanLoop": "false"
}
> {%
client.test("Personal loan creation successful", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 200, "Response code is 200");
client.assert(response.body.data.custType === "", "Customer type is ");
client.assert(response.body.data.serialNum !== null, "Serial number is generated");
});
%}
### ============================================================
### 3. - custIsn
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custName": "",
"idType": "",
"idNum": "110101199001011234",
"guarType": "",
"applyAmt": "500000"
}
> {%
client.test("Missing custIsn validation works", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 500, "Response code indicates validation error");
});
%}
### ============================================================
### 4. - guarType
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "TEST002",
"custName": "",
"idType": "",
"idNum": "110101199001011235",
"applyAmt": "300000"
}
> {%
client.test("Missing guarType validation works", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 500, "Response code indicates validation error");
});
%}
### ============================================================
### 5. - applyAmt
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "TEST003",
"custName": "",
"guarType": "",
"idType": "",
"idNum": "110101199001011236"
}
> {%
client.test("Missing applyAmt validation works", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 500, "Response code indicates validation error");
});
%}
### ============================================================
### 6. -
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "TEST004",
"custName": "",
"idType": "",
"idNum": "110101199001011237",
"guarType": "",
"applyAmt": "200000"
}
> {%
client.test("Invalid guarType validation works", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 500, "Response code indicates validation error");
});
%}
### ============================================================
### 7. -
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "TEST005",
"custName": "",
"idType": "",
"idNum": "110101199001011238",
"guarType": "",
"applyAmt": "800000",
"bizProof": "true",
"loanLoop": "true",
"collType": "",
"collThirdParty": "false"
}
> {%
client.test("Personal loan with collateral info", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 200, "Response code is 200");
client.assert(response.body.data.collType === "", "Collateral type is correct");
client.assert(response.body.data.loanLoop === "true", "Loan loop is set");
});
%}
### ============================================================
### 8. -
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/personal
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "TEST006",
"custName": "",
"idType": "",
"idNum": "110101199001011239",
"guarType": "",
"applyAmt": "100000",
"bizProof": "false",
"loanLoop": "false",
"collType": "",
"collThirdParty": "true"
}
> {%
client.test("Personal loan with all required fields", function () {
client.assert(response.status === 200, "Response status is 200");
client.assert(response.body.code === 200, "Response code is 200");
client.assert(response.body.data.collThirdParty === "true", "Collateral third party is set");
});
%}