Skip to content

Improvements for use in integration tests #111

@jkuek

Description

@jkuek

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure a similar issue has not already been created

Description

Hi, I'm evaluating Mockaco for use in integration tests. I'm hoping to use it to mock the third-party push notification and SMS services as other integrations so that I can confirm that our platform is correctly making the requests to these services.

Previously we were using getsandbox.com but that is now discontinued. I have a number of tests that I need to refactor.

However, I have run into a few limitations which seem to prevent Mockaco from meeting my needs:

  1. The timestamp provided in verification is in format hh:mm, which isn't really specific enough. I would prefer ISO8601 format or at minimum hh:mm:ss. My tests take seconds to run, not minutes, so it's useful to be able to confirm exactly when the request was made.
  2. It would be useful to be able to clear the cache programmatically, e.g. with a DELETE http://localhost:5000/_mockaco/verification request or similar
  3. Sometimes a test might result in multiple requests to the same route with different bodies. Is there any way currently of retrieving the list of calls made to Mockaco?

Proposed solution

  1. Change timestamp property in verification response to ISO8601 format.
  2. Add new special route to clear the cache (e.g. GET /_mockaco/clear or DELETE /_mockaco/verification)
  3. Add new special route to list all calls made to a route (e.g. GET /_mockaco/list?route={route} )

Alternatives

I have considered writing my own mock server to do exactly what I want, but it seems like this functionality would be useful for everyone? I'm open to suggestions for other platforms/software that I could use to achieve my goals.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions