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

[mojaloop-testing-toolkit] Endpoint that retrieves an array of requests sent to the TTK and an array of callbacks send by the TTK #2262

Closed
13 tasks done
kleyow opened this issue Jun 7, 2021 · 2 comments
Assignees
Labels
oss-ttk Related to the Mojaloop testing toolkit story
Milestone

Comments

@kleyow
Copy link

kleyow commented Jun 7, 2021

Goal:

As a user of the TTK

I want to be able to query the TTK for a history of requests made to it and a history of callbacks/responses it sends back.

so that I can run assertions on what the TTK is sending and recieving.

Acceptance Criteria:

  • GET /api/history/requests that returns list of requests sent to TTK
  • GET /api/history/callbacks that returns list of callbacks sent from TTK

Something a long the lines of a GET /history/requests endpoint that returns a list of requests the TTK has recieved.
This list needs to retrieve all GET/PUT/PATCH/DELETE/POST requests made to the TTK.

{
  requestHistory: [
     {
        endpointPath: '...',
        requestBody: {...},
        headers: {...},
        timestamp: '...',
        ...
     },
     {
        endpointPath: '...',
        requestBody: {...},
        headers: {...},
        timestamp: '...',
        ...
     }
  ]
}

Something similar for `/history/callbacks` 

Complexity: Low

Uncertainty: Low


Tasks:

  • Implement a store for storing arrays like object store
  • Store the requests and callbacks in proper format in the store
  • Expose API endpoints for getting the requests and callbacks history
  • Add delete endpoints to clear the history

Done

  • Acceptance Criteria pass
  • Designs are up-to date
  • Unit Tests pass
  • Integration Tests pass
  • Code Style & Coverage meets standards
  • Changes made to config (default.json) are broadcast to team and follow-up tasks added to update helm charts and other deployment config.

Pull Requests:

Follow-up:

  • N/A

Dependencies:

  • N/A

Accountability:

  • Owner: TBC
  • QA/Review: TBC
@kleyow kleyow added the story label Jun 7, 2021
@vijayg10 vijayg10 added oss-ttk Related to the Mojaloop testing toolkit to-be-refined This story is ready to be groomed labels Jun 7, 2021
@vijayg10 vijayg10 self-assigned this Jun 7, 2021
@elnyry-sam-k elnyry-sam-k added this to the Sprint 14.3 milestone Jun 8, 2021
@elnyry-sam-k elnyry-sam-k removed the to-be-refined This story is ready to be groomed label Jun 8, 2021
@kleyow
Copy link
Author

kleyow commented Jun 8, 2021

Closing this story. Similar functionality is covered by the /api/objectStore/requestsHistory and http://localhost:5050/api/objectStore/callbacksHistory endpoints

@kleyow kleyow closed this as completed Jun 8, 2021
@elnyry-sam-k elnyry-sam-k reopened this Jun 8, 2021
@vijayg10
Copy link

vijayg10 commented Jun 8, 2021

Added the endpoints /api/history/requests and /api/history/callbacks to get the full history of requests and callbacks.
The history lasts upto 10 minutes.
The format will be like below

[
    {
        "timestamp": 1623163149634,
        "url": "http://localhost:4000/parties/MSISDN/000111",
        "method": "put",
        "path": "/parties/MSISDN/000111",
        "headers": {
            "Content-Type": "application/vnd.interoperability.parties+json;version=1.0",
            "Date": "Tue, 08 Jun 2021 14:39:09 GMT"
        },
        "body": {
            "party": {
                "partyIdInfo": {
                    "partyIdType": "MSISDN",
                    "partyIdentifier": "000111",
                    "fspId": "testingtoolkitdfsp"
                },
                "name": "voluptate"
            }
        }
    },
    {
        "timestamp": 1623163149797,
        "url": "http://localhost:4000/quotes/39683541-95d2-41cb-93e3-8dfbfc26c956",
        "method": "put",
        "path": "/quotes/39683541-95d2-41cb-93e3-8dfbfc26c956",
        "headers": {
            "Content-Type": "application/vnd.interoperability.quotes+json;version=1.1",
            "Date": "Tue, 08 Jun 2021 14:39:09 GMT"
        },
        "body": {
            "transferAmount": {
                "currency": "USD",
                "amount": "100"
            },
            "expiration": "2040-01-01T01:01:01.001Z",
        }
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oss-ttk Related to the Mojaloop testing toolkit story
Projects
None yet
Development

No branches or pull requests

3 participants