Closed jonathanvila closed 3 years ago
Issue : https://github.com/konveyor/tackle-pathfinder/issues/89
In order to test :
podman run -ti --name keycloak --rm \ -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e KEYCLOAK_IMPORT=/tmp/keycloak/quarkus-realm.json \ -e DB_VENDOR=h2 -p 8180:8080 -p 8543:8443 -v ./src/main/resources/keycloak:/tmp/keycloak:Z \ jboss/keycloak:12.0.2
podman run -it \ --name postgres-pathfinder -e POSTGRES_USER=pathfinder \ -e POSTGRES_PASSWORD=pathfinder -e POSTGRES_DB=pathfinder_db \ -p 5433:5432 postgres:10.6
mvn quarkus:dev
podman exec -it postgres-pathfinder /usr/bin/psql pathfinder_db -U pathfinder -c "$(cat src/main/resources/db/test-data/V0.0.4_001.1__insert_translations.sql)"
5. execute the check_api.sh
.github/scripts/check_api.sh localhost:8085 localhost:8180
6. obtain the token
export access_token=$(curl -X POST "http://localhost:8180/auth/realms/quarkus/protocol/openid-connect/token" \ --user backend-service:secret \ -H 'content-type: application/x-www-form-urlencoded' \ -d 'username=alice&password=alice&grant_type=password' | jq --raw-output '.access_token')
7. obtain landscape report and check field applicationId is included
curl "http://localhost:8085/pathfinder/assessments/assessment-risk" \ -H 'Accept: application/json' \ -H "Authorization: Bearer $access_token" -w "%{http_code}" \ -d "[{\"applicationId\":325100},{\"applicationId\":998899}]" \ -H 'Content-Type: application/json'
Issue : https://github.com/konveyor/tackle-pathfinder/issues/89
In order to test :
mvn quarkus:dev
.github/scripts/check_api.sh localhost:8085 localhost:8180
export access_token=$(curl -X POST "http://localhost:8180/auth/realms/quarkus/protocol/openid-connect/token" \ --user backend-service:secret \ -H 'content-type: application/x-www-form-urlencoded' \ -d 'username=alice&password=alice&grant_type=password' | jq --raw-output '.access_token')
curl "http://localhost:8085/pathfinder/assessments/assessment-risk" \ -H 'Accept: application/json' \ -H "Authorization: Bearer $access_token" -w "%{http_code}" \ -d "[{\"applicationId\":325100},{\"applicationId\":998899}]" \ -H 'Content-Type: application/json'