Package com.jcabi.github.mock
Class MkOrganization
java.lang.Object
com.jcabi.github.mock.MkOrganization
- All Implemented Interfaces:
JsonPatchable,JsonReadable,Organization,Comparable<Organization>
Mock GitHub organization.
- Since:
- 0.24
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.Organization
Organization.Smart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the given user to this organization.intcompareTo(Organization obj) github()GitHub we're in.jakarta.json.JsonObjectjson()Describe it in a JSON object.login()Get this organization's login.voidpatch(jakarta.json.JsonObject json) Patch using this JSON object.Get this organization's public members.
-
Constructor Details
-
MkOrganization
Public ctor.- Parameters:
stg- Storagelogin- Username of organization
-
-
Method Details
-
github
Description copied from interface:OrganizationGitHub we're in.- Specified by:
githubin interfaceOrganization- Returns:
- GitHub
-
login
Description copied from interface:OrganizationGet this organization's login.- Specified by:
loginin interfaceOrganization- Returns:
- Login name
-
json
public jakarta.json.JsonObject json()Description copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
-
compareTo
- Specified by:
compareToin interfaceComparable<Organization>
-
patch
Description copied from interface:JsonPatchablePatch using this JSON object.- Specified by:
patchin interfaceJsonPatchable- Parameters:
json- JSON object- Throws:
IOException- If there is any I/O problem
-
publicMembers
Description copied from interface:OrganizationGet this organization's public members.- Specified by:
publicMembersin interfaceOrganization- Returns:
- Public members
-
addMember
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).
-