mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 09:26:53 +00:00
test h2 db file clear at run_all_tests 2
This commit is contained in:
parent
04f04f23a6
commit
44cfd59c9a
@ -1,8 +1,20 @@
|
||||
# Contributing
|
||||
|
||||
|
||||
## Hello!
|
||||
|
||||
## Coding Standards
|
||||
|
||||
### Character Encoding
|
||||
|
||||
- **Use UTF-8 encoding** for all source files
|
||||
- **DO NOT use emojis** in source code (scripts, Scala, Java, config files, etc.)
|
||||
- **Emojis are only allowed in Markdown (.md) files** - use them if you must.
|
||||
- **Avoid non-ASCII characters** in code unless absolutely necessary (e.g., comments in non-English languages)
|
||||
- Use plain ASCII alternatives in source code:
|
||||
- Instead of checkmark use [OK] or PASS
|
||||
- Instead of X mark use [FAIL] or ERROR
|
||||
- Instead of multiply use x
|
||||
- Instead of arrow use -> or <-
|
||||
Thank you for your interest in contributing to the Open Bank Project!
|
||||
|
||||
## Pull requests
|
||||
@ -14,6 +26,7 @@ If you end up making large changes to the source code, we might ask for a paper
|
||||
## Git commit messages
|
||||
|
||||
Please structure git commit messages in a way as shown below:
|
||||
|
||||
1. bugfix/Something
|
||||
2. feature/Something
|
||||
3. docfix/Something
|
||||
@ -89,6 +102,7 @@ When naming variables use strict camel case e.g. use myUrl not myURL. This is so
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Recommended order of checks at an endpoint
|
||||
|
||||
```scala
|
||||
@ -105,7 +119,9 @@ When naming variables use strict camel case e.g. use myUrl not myURL. This is so
|
||||
failMsg = s"$InvalidJsonFormat The Json body should be the $PostPutProductJsonV310 "
|
||||
...
|
||||
```
|
||||
|
||||
Please note that that checks at an endpoint should be applied only in case an user is authorized and has privilege to consume the endpoint. Otherwise we can reveal sensitive data to the user. For instace if we reorder the checks in next way:
|
||||
|
||||
```scala
|
||||
// 1. makes sure the user which attempts to use the endpoint is authorized
|
||||
(Full(u), callContext) <- authorizedAccess(cc)
|
||||
@ -116,12 +132,14 @@ Please note that that checks at an endpoint should be applied only in case an us
|
||||
// 2. makes sure the user which attempts to use the endpoint is allowed to consume it
|
||||
_ <- NewStyle.function.hasAtLeastOneEntitlement(failMsg = createProductEntitlementsRequiredText)(bankId.value, u.userId, createProductEntitlements, callContext)
|
||||
```
|
||||
|
||||
the user which cannot consume the endpoint still can check does some bank exist or not at that instance. It's not the issue if banks are public data at the instance but it wouldn't be the only business case all the time.
|
||||
|
||||
## Writing tests
|
||||
|
||||
When you write a test for an endpoint please tag it with a version and the endpoint.
|
||||
An example of how to tag tests:
|
||||
|
||||
```scala
|
||||
class FundsAvailableTest extends V310ServerSetup {
|
||||
|
||||
@ -155,6 +173,7 @@ class FundsAvailableTest extends V310ServerSetup {
|
||||
```
|
||||
|
||||
## Code Generation
|
||||
|
||||
We support to generate the OBP-API code from the following three types of json. You can choose one of them as your own requirements.
|
||||
|
||||
1 Choose one of the following types: type1 or type2 or type3
|
||||
@ -166,16 +185,21 @@ We support to generate the OBP-API code from the following three types of json.
|
||||
Here are the three types:
|
||||
|
||||
Type1: If you use `modelSource.json`, please run `APIBuilderModel.scala` main method
|
||||
|
||||
```
|
||||
/OBP-API/obp-api/src/main/resources/apiBuilder/APIModelSource.json
|
||||
/OBP-API/obp-api/src/main/scala/code/api/APIBuilder/APIBuilderModel.scala
|
||||
```
|
||||
|
||||
Type2: If you use `apisResource.json`, please run `APIBuilder.scala` main method
|
||||
|
||||
```
|
||||
/OBP-API/obp-api/src/main/resources/apiBuilder/apisResource.json
|
||||
OBP-API/src/main/scala/code/api/APIBuilder/APIBuilder.scala
|
||||
```
|
||||
|
||||
Type3: If you use `swaggerResource.json`, please run `APIBuilderSwagger.scala` main method
|
||||
|
||||
```
|
||||
/OBP-API/obp-api/src/main/resources/apiBuilder/swaggerResource.json
|
||||
OBP-API/src/main/scala/code/api/APIBuilder/APIBuilderSwagger.scala
|
||||
|
||||
@ -178,7 +178,7 @@ display_warning_factors() {
|
||||
fi
|
||||
|
||||
# Format with count prominence
|
||||
printf " ${YELLOW}%4d ×${NC} %s\n" "$count" "$message" | tee -a "${SUMMARY_LOG}" > /dev/tty
|
||||
printf " ${YELLOW}%4d x${NC} %s\n" "$count" "$message" | tee -a "${SUMMARY_LOG}" > /dev/tty
|
||||
|
||||
displayed=$((displayed + 1))
|
||||
done < "${analysis_file}"
|
||||
@ -252,7 +252,7 @@ for dbfile in "${TEST_DB_PATTERNS[@]}"; do
|
||||
if [ -f "$dbfile" ]; then
|
||||
FOUND_FILES=true
|
||||
rm -f "$dbfile"
|
||||
log_message " ${GREEN}✓${NC} Deleted: $dbfile"
|
||||
log_message " ${GREEN}[OK]${NC} Deleted: $dbfile"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user