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
See Also:
  • Constructor Details

    • MkOrganization

      public MkOrganization(MkStorage stg, String login)
      Public ctor.
      Parameters:
      stg - Storage
      login - Username of organization
  • Method Details

    • github

      public GitHub github()
      Description copied from interface: Organization
      GitHub we're in.
      Specified by:
      github in interface Organization
      Returns:
      GitHub
    • login

      public String login()
      Description copied from interface: Organization
      Get this organization's login.
      Specified by:
      login in interface Organization
      Returns:
      Login name
    • json

      public jakarta.json.JsonObject json()
      Description copied from interface: JsonReadable
      Describe it in a JSON object.
      Specified by:
      json in interface JsonReadable
      Returns:
      JSON object
    • compareTo

      public int compareTo(Organization obj)
      Specified by:
      compareTo in interface Comparable<Organization>
    • patch

      public void patch(jakarta.json.JsonObject json) throws IOException
      Description copied from interface: JsonPatchable
      Patch using this JSON object.
      Specified by:
      patch in interface JsonPatchable
      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 interface Organization
      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).