Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add e2e tests for consentRequests #131

Merged
merged 6 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions docker-local/dfsp_a/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,112 @@
]
}
}
},
{
"ruleId": 4,
"description": "validate consentRequests- WEB",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/validateConsentRequests"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
},
{
"fact": "body",
"operator": "equal",
"value": "b51ec534-ee48-4575-b6a9-ead2955b8069",
"path": ".id"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {
"isValid": true,
"authChannels": [
"WEB"
],
"authUri": "dfspa.com/authorize?consentRequestId=xxx-xxxx"
eoln marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
},
{
"ruleId": 5,
"description": "validate consentRequests -OTP",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/validateConsentRequests"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
},
{
"fact": "body",
"operator": "equal",
"value": "c51ec534-ee48-4575-b6a9-ead2955b8069",
"path": ".id"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {
"isValid": true,
"authChannels": [
"OTP"
]
}
}
}
},
{
"ruleId": 6,
"description": "validate consentRequests -Error",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/validateConsentRequests"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
},
{
"fact": "body",
"operator": "equal",
"value": "d51ec534-ee48-4575-b6a9-ead2955b8069",
"path": ".id"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {
"isValid": false,
"authChannels": []
}
}
}
}
]
115 changes: 111 additions & 4 deletions docker-local/dfsp_b/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,124 @@
"statusCode": 200,
"body": [
{
"accountNickname": "dfspa.user.nickname1",
"id": "dfspa.username.1234",
"accountNickname": "dfspb.user.nickname1",
sridharvoruganti marked this conversation as resolved.
Show resolved Hide resolved
"id": "dfspb.username.1234",
"currency": "ZAR"
},
{
"accountNickname": "dfspa.user.nickname2",
"id": "dfspa.username.5678",
"accountNickname": "dfspb.user.nickname2",
"id": "dfspb.username.5678",
"currency": "USD"
}
]
}
}
},
{
"ruleId": 3,
"description": "validate consentRequests- WEB",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/validateConsentRequests"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
},
{
"fact": "body",
"operator": "equal",
"value": "b51ec534-ee48-4575-b6a9-ead2955b8069",
"path": ".id"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {
"isValid": true,
"authChannels": [
"WEB"
],
"authUri": "dfspb.com/authorize?consentRequestId=xxx-xxxx"
}
}
}
},
{
"ruleId": 4,
"description": "validate consentRequests -OTP",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/validateConsentRequests"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
},
{
"fact": "body",
"operator": "equal",
"value": "c51ec534-ee48-4575-b6a9-ead2955b8069",
"path": ".id"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {
"isValid": true,
"authChannels": [
"OTP"
]
}
}
}
},
{
"ruleId": 5,
"description": "validate consentRequests -Error",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/validateConsentRequests"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
},
{
"fact": "body",
"operator": "equal",
"value": "d51ec534-ee48-4575-b6a9-ead2955b8069",
"path": ".id"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {
"isValid": false,
"authChannels": []
}
}
}
}
]
18 changes: 9 additions & 9 deletions docker-local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ services:

## DFSP A
dfspa-backend:
image: "mojaloop/mojaloop-simulator:v11.3.0.3-pisp"
image: "mojaloop/mojaloop-simulator:v11.3.0.4-pisp"
# build:
# context: ../../mojaloop-simulator
# dockerfile: ./Dockerfile
Expand Down Expand Up @@ -350,7 +350,7 @@ services:
- "dfspa-backend:172.17.0.1"

dfspa-thirdparty-scheme-adapter-inbound:
image: "mojaloop/thirdparty-scheme-adapter:v11.32.0"
image: "mojaloop/thirdparty-scheme-adapter:v11.34.0"
# build:
# context: ../../thirdparty-scheme-adapter
# dockerfile: ./docker/Dockerfile
Expand Down Expand Up @@ -401,7 +401,7 @@ services:
- "pisp-thirdparty-api-adapter:172.17.0.1"

dfspa-thirdparty-scheme-adapter-outbound:
image: "mojaloop/thirdparty-scheme-adapter:v11.32.0"
image: "mojaloop/thirdparty-scheme-adapter:v11.34.0"
# build:
# context: ../../thirdparty-scheme-adapter
# dockerfile: ./docker/Dockerfile
Expand Down Expand Up @@ -458,7 +458,7 @@ services:

## DFSP B
dfspb-backend:
image: "mojaloop/mojaloop-simulator:v11.3.0.3-pisp"
image: "mojaloop/mojaloop-simulator:v11.3.0.4-pisp"
container_name: dfspb-backend
env_file: ./dfsp_b/dfsp_b_backend.env
volumes:
Expand Down Expand Up @@ -513,7 +513,7 @@ services:
- "dfspb-backend:172.17.0.1"

dfspb-thirdparty-scheme-adapter-inbound:
image: "mojaloop/thirdparty-scheme-adapter:v11.32.0"
image: "mojaloop/thirdparty-scheme-adapter:v11.34.0"
# build:
# context: ../../thirdparty-scheme-adapter
# dockerfile: ./docker/Dockerfile
Expand Down Expand Up @@ -562,7 +562,7 @@ services:
- "pisp-thirdparty-api-adapter:172.17.0.1"

dfspb-thirdparty-scheme-adapter-outbound:
image: "mojaloop/thirdparty-scheme-adapter:v11.32.0"
image: "mojaloop/thirdparty-scheme-adapter:v11.34.0"
# build:
# context: ../../thirdparty-scheme-adapter
# dockerfile: ./docker/Dockerfile
Expand Down Expand Up @@ -619,7 +619,7 @@ services:

## PISP
pisp-backend:
image: "mojaloop/mojaloop-simulator:v11.3.0.3-pisp"
image: "mojaloop/mojaloop-simulator:v11.3.0.4-pisp"
container_name: pisp-backend
env_file: ./pisp/pisp_backend.env
volumes:
Expand Down Expand Up @@ -675,7 +675,7 @@ services:
- "pisp-backend:172.17.0.1"

pisp-thirdparty-scheme-adapter-inbound:
image: "mojaloop/thirdparty-scheme-adapter:v11.32.0"
image: "mojaloop/thirdparty-scheme-adapter:v11.34.0"
# build:
# context: ../../thirdparty-scheme-adapter
# dockerfile: ./docker/Dockerfile
Expand Down Expand Up @@ -724,7 +724,7 @@ services:
- "pisp-backend:172.17.0.1"

pisp-thirdparty-scheme-adapter-outbound:
image: "mojaloop/thirdparty-scheme-adapter:v11.32.0"
image: "mojaloop/thirdparty-scheme-adapter:v11.34.0"
# build:
# context: ../../thirdparty-scheme-adapter
# dockerfile: ./docker/Dockerfile
Expand Down
36 changes: 0 additions & 36 deletions docker-local/pisp/pisp_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,5 @@
"body": ""
}
}
},
{
"ruleId": 2,
"description": "Returns list of user Accounts",
"conditions": {
"all": [
{
"fact": "path",
"operator": "equal",
"value": "/accounts/username1234"
},
{
"fact": "method",
"operator": "equal",
"value": "GET"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": [
{
"accountNickname": "dfspa.user.nickname1",
"id": "dfspa.username.1234",
"currency": "ZAR"
},
{
"accountNickname": "dfspa.user.nickname2",
"id": "dfspa.username.5678",
"currency": "USD"
}
]
}
}
}
]
Loading