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

225 lines
7.4 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/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP001",
"custName": "",
"idType": "",
"idNum": "91110000100000000X",
"guarType": "",
"applyAmt": "1000000",
"loanTerm": "36",
"isAgriGuar": "false",
"isGreenLoan": "true",
"isTechEnt": "true"
}
> {%
client.test("Corporate 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");
client.assert(response.body.data.loanTerm === "36", "Loan term is correct");
});
%}
### ============================================================
### 3. - custIsn
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custName": "2",
"idType": "",
"idNum": "91110000100000001X",
"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/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP002",
"custName": "3",
"idType": "",
"idNum": "91110000100000002X",
"applyAmt": "800000"
}
> {%
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/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP003",
"custName": "4",
"guarType": "",
"idType": "",
"idNum": "91110000100000003X"
}
> {%
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/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP004",
"custName": "5",
"idType": "",
"idNum": "91110000100000004X",
"guarType": "",
"applyAmt": "600000"
}
> {%
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/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP005",
"custName": "",
"idType": "",
"idNum": "91110000100000005X",
"guarType": "",
"applyAmt": "2000000",
"loanTerm": "60",
"isAgriGuar": "true"
}
> {%
client.test("Corporate loan with agricultural guarantee", 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.isAgriGuar === "true", "Agricultural guarantee is set");
});
%}
### ============================================================
### 8. -
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP006",
"custName": "",
"idType": "",
"idNum": "91110000100000006X",
"guarType": "",
"applyAmt": "1500000",
"loanTerm": "24",
"isTradeConstruction": "true"
}
> {%
client.test("Corporate loan for trade/construction", 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.isTradeConstruction === "true", "Trade/construction flag is set");
});
%}
### ============================================================
### 9. -
### ============================================================
POST http://localhost:8080/loanPricing/workflow/create/corporate
Authorization: Bearer {{token}}
Content-Type: application/json
{
"custIsn": "CORP007",
"custName": "",
"idType": "",
"idNum": "91110000100000007X",
"guarType": "",
"applyAmt": "3000000",
"loanTerm": "12",
"isAgriGuar": "false",
"isGreenLoan": "true",
"isTechEnt": "true",
"isTradeConstruction": "false",
"collType": "",
"collThirdParty": "false"
}
> {%
client.test("Corporate 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");
});
%}