-
Notifications
You must be signed in to change notification settings - Fork 97
feat: add get and update endpoints for org members #150
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #150 +/- ##
============================================
+ Coverage 75.64% 75.83% +0.19%
- Complexity 279 284 +5
============================================
Files 42 42
Lines 969 985 +16
Branches 42 43 +1
============================================
+ Hits 733 747 +14
- Misses 211 212 +1
- Partials 25 26 +1
|
| @Test | ||
| public void updateMembership() throws Exception { | ||
| final OrgMembershipCreate orgMembershipCreateRequest = | ||
| json.fromJson(getFixture("membership_update.json"), OrgMembershipCreate.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this fixture included in resources. Does it already exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this already exists, both the team memberships and org memberships have the same request schema so it didn't seem worth it to create a new file with the same content. They have different responses though, so that's been reflect with the new file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying.
| public CompletableFuture<OrgMembership> updateOrgMembership(final OrgMembershipCreate request, final String username) { | ||
| final String path = String.format(MEMBERSHIP_TEMPLATE, org, username); | ||
| log.debug("Updating membership in org: " + path); | ||
| return github.put(path, github.json().toJsonUnchecked(request), OrgMembership.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we're using json unchecked here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly was just following what was already being used in other tests.
What does this PR do?
Exposes the ability to PUT and GET organisation members
How to test?
Unit tests have been updated to reflect these changes