feat: add get and update endpoints for org members#150
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.
I don't see this fixture included in resources. Does it already exist?
There was a problem hiding this comment.
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.
| 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.
Is there a reason we're using json unchecked here?
There was a problem hiding this comment.
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