The testing suite is mainly integration testing. It requires a local docker-engine to be running. Integration tests spin up a local postgres database and run the application against it. The 3rd party APIs are mocked using wiremock
cargo test
runs all tests.
# start
docker run --name local-postgres -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -d postgres
# stop & remove
docker rm -f local-postgres
The following Gitlab API authentication methods are supported:
curl --header "PRIVATE-TOKEN: XXX" "https://gitlab.com/api/v4/projects/{}"
curl --header "Authorization: Bearer XXX" "https://gitlab.com/api/v4/projects/{}"
The Atlassian's API authentication method is Basic Authentication:
# generate base64 string from user:api_token used for Basic Authentication header
echo -n [email protected]:api_token_string | base64
curl curl -D- \
-X GET \
-H "Authorization: Basic some_base64_string" \
-H "Content-Type: application/json" \
"https://your-domain.atlassian.net/rest/api/2/issue/ISSUE-Z"