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

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

Open
uladzimir-tryputska opened this issue Oct 11, 2022 · 0 comments

Comments

@uladzimir-tryputska
Copy link

uladzimir-tryputska commented Oct 11, 2022

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

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

No branches or pull requests

1 participant