Skip to content

Unexported fields in API structs lead to problems with API mocking #19

Description

@vladimir-tryputska

Is your feature request related to a problem? Please describe.
statuscale-go client has interfaces like UptimeAPI, which is great. It allows us to mock them in our unit tests. The problem is with structs like APICreateUptimeTestRequest or APIUpdateUptimeTestRequest, where fields are private and there are not read-access methods. So we cannot really validate in tests whether properties have valid values. Workaround would be to use httpmock, which raises a question of the necessity of the statuscake-go client in general. In this case we could use REST api.

Describe the solution you'd like
It would be great to have properties exported in structs like APICreateUptimeTestRequest or APIUpdateUptimeTestRequest

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions