Skip to content

Added method to list authorizations#481

Merged
bitwiseman merged 4 commits into
hub4j:masterfrom
martinvanzijl:issue_459_list_authorizations
Oct 8, 2019
Merged

Added method to list authorizations#481
bitwiseman merged 4 commits into
hub4j:masterfrom
martinvanzijl:issue_459_list_authorizations

Conversation

@martinvanzijl
Copy link
Copy Markdown
Contributor

Fixes issue #459.

Added method GitHub.listMyAuthorizations().

Copy link
Copy Markdown
Member

@bitwiseman bitwiseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! How about some tests as well?

bitwiseman and others added 3 commits October 4, 2019 00:43
- Added missing brace at end of listMyAuthorizations().
- Added unit test for listMyAuthorizations().
@martinvanzijl
Copy link
Copy Markdown
Contributor Author

@bitwiseman I added a basic unit test. Can you please check?

I'm not sure how to check that the authorizations themselves are correct, since they depend on the user running the test. Can I change to a "known user" in the test itself?

@bitwiseman
Copy link
Copy Markdown
Member

@martinvanzijl
TL;DR - What you've written is good enough.

Kohsuke had a separate dummy login that he used for this, but that doesn't scale to more people. Where possible I'd like tests to use the github-api-test-org since multiple people can use it interchangeably. what that isn't possible (as here), then the snapshot you take is good enough. The snapshot becomes the "known user"/stable data. 😄

You can then add checks against that stable data and anyone running the test should get the same result. Maybe mark the test using the snapshotNotAllowed() method and explain why.

FYI: I'd like to have robust tests that can be re-snapshotted freely, but if that can't be accomplished without a lot of extra work, I'm okay with tests that verify the functionality in CI using canned data that may require work to update if the tests change.

@bitwiseman bitwiseman merged commit 7e0d61a into hub4j:master Oct 8, 2019
@bitwiseman bitwiseman removed their request for review October 8, 2019 02:04
@martinvanzijl martinvanzijl deleted the issue_459_list_authorizations branch October 9, 2019 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants