Package com.jcabi.github.mock
Class MkOrganization
- java.lang.Object
-
- com.jcabi.github.mock.MkOrganization
-
- All Implemented Interfaces:
JsonPatchable
,JsonReadable
,Organization
,Comparable<Organization>
@Immutable @Loggable(1) public final class MkOrganization extends Object implements Organization
Mock GitHub organization.- Since:
- 0.24
- Version:
- $Id: c04e47f965d345c60423d75f72ec54ac7b10609a $
- Author:
- Paul Polishchuk (ppol@ua.fm)
- See Also:
- Organizations API
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Organization
Organization.Smart
-
-
Constructor Summary
Constructors Constructor Description MkOrganization(MkStorage stg, String login)
Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMember(User user)
Add the given user to this organization.int
compareTo(Organization obj)
Github
github()
Github we're in.javax.json.JsonObject
json()
Describe it in a JSON object.String
login()
Get this organization's login.void
patch(javax.json.JsonObject json)
Patch using this JSON object.PublicMembers
publicMembers()
Get this organization's public members.
-
-
-
Method Detail
-
github
public Github github()
Description copied from interface:Organization
Github we're in.- Specified by:
github
in interfaceOrganization
- Returns:
- Github
-
login
public String login()
Description copied from interface:Organization
Get this organization's login.- Specified by:
login
in interfaceOrganization
- Returns:
- Login name
-
json
public javax.json.JsonObject json()
Description copied from interface:JsonReadable
Describe it in a JSON object.- Specified by:
json
in interfaceJsonReadable
- Returns:
- JSON object
-
compareTo
public int compareTo(Organization obj)
- Specified by:
compareTo
in interfaceComparable<Organization>
-
patch
public void patch(javax.json.JsonObject json) throws IOException
Description copied from interface:JsonPatchable
Patch using this JSON object.- Specified by:
patch
in interfaceJsonPatchable
- Parameters:
json
- JSON object- Throws:
IOException
- If there is any I/O problem
-
publicMembers
public PublicMembers publicMembers()
Description copied from interface:Organization
Get this organization's public members.- Specified by:
publicMembers
in interfaceOrganization
- Returns:
- Public members
-
addMember
public void addMember(User user)
Add the given user to this organization.- Parameters:
user
- User to add to the organization- To do:
- #1107:30min Implement the "Add team membership" API (see https://developer.github.com/v3/orgs/teams/#add-team-membership ) (per https://developer.github.com/v3/orgs/members/#add-a-member , you can't add a user directly to an org; you instead add them to one of that org's teams) and replace uses of this method with uses of that API (or downgrade this method to a convenience method for unit tests).
-
-