Class MockApplicationRole

java.lang.Object
com.atlassian.jira.application.MockApplicationRole
All Implemented Interfaces:
ApplicationRole

public class MockApplicationRole extends Object implements ApplicationRole
  • Constructor Details

    • MockApplicationRole

      public MockApplicationRole()
    • MockApplicationRole

      public MockApplicationRole(com.atlassian.application.api.ApplicationKey key)
    • MockApplicationRole

      public MockApplicationRole(ApplicationRole copy)
  • Method Details

    • key

      public MockApplicationRole key(String id)
    • key

      public MockApplicationRole key(com.atlassian.application.api.ApplicationKey key)
    • name

      public MockApplicationRole name(String name)
    • groups

      public MockApplicationRole groups(com.atlassian.crowd.embedded.api.Group... groups)
    • groupNames

      public MockApplicationRole groupNames(String... groups)
    • groups

      public MockApplicationRole groups(Iterable<com.atlassian.crowd.embedded.api.Group> groups)
    • groupNames

      public MockApplicationRole groupNames(Iterable<String> groups)
    • defaultGroups

      public MockApplicationRole defaultGroups(com.atlassian.crowd.embedded.api.Group... group)
    • defaultGroupNames

      public MockApplicationRole defaultGroupNames(String... names)
    • defaultGroups

      public MockApplicationRole defaultGroups(Iterable<com.atlassian.crowd.embedded.api.Group> groups)
    • defaultGroupNames

      public MockApplicationRole defaultGroupNames(Iterable<String> names)
    • numberOfSeats

      public MockApplicationRole numberOfSeats(int numberOfLicenseSeats)
    • selectedByDefault

      public MockApplicationRole selectedByDefault(boolean selectedByDefault)
    • defined

      public MockApplicationRole defined(boolean defined)
    • unlimitedSeats

      public MockApplicationRole unlimitedSeats()
    • getKey

      @Nonnull public com.atlassian.application.api.ApplicationKey getKey()
      Description copied from interface: ApplicationRole
      Returns the canonical ApplicationKey that uniquely identifies this ApplicationRole.
      Specified by:
      getKey in interface ApplicationRole
      Returns:
      the canonical ApplicationKey that uniquely identifies this ApplicationRole.
    • getName

      @Nonnull public String getName()
      Description copied from interface: ApplicationRole
      Return the name of the ApplicationRole. The name is i18ned for the calling user if possible.
      Specified by:
      getName in interface ApplicationRole
      Returns:
      the name of the ApplicationRole role. The name is i18ned for the calling user if possible.
    • getGroups

      @Nonnull public Set<com.atlassian.crowd.embedded.api.Group> getGroups()
      Description copied from interface: ApplicationRole
      Return the set of groups associated with the role including the default ones.
      Specified by:
      getGroups in interface ApplicationRole
      Returns:
      the groups associated with the role.
    • getDefaultGroups

      @Nonnull public Set<com.atlassian.crowd.embedded.api.Group> getDefaultGroups()
      Description copied from interface: ApplicationRole
      Return the default groups configured for the role.
      Specified by:
      getDefaultGroups in interface ApplicationRole
      Returns:
      Set with the default groups associated with the role, set will be empty if there are no default groups.
    • withGroups

      @Nonnull public ApplicationRole withGroups(@Nonnull Iterable<com.atlassian.crowd.embedded.api.Group> groups, @Nonnull Iterable<com.atlassian.crowd.embedded.api.Group> defaultGroups)
      Description copied from interface: ApplicationRole
      Return a new ApplicationRole with its groups and default groups set to the passed values.
      Specified by:
      withGroups in interface ApplicationRole
      Parameters:
      groups - the groups associated with the role.
      defaultGroups - default groups for the role.
      Returns:
      a new ApplicationRole with its groups and default groups set to the passed arguments.
    • getNumberOfSeats

      public int getNumberOfSeats()
      Description copied from interface: ApplicationRole
      Returns the total number of seats of this ApplicationRole issued with the licence.
      Specified by:
      getNumberOfSeats in interface ApplicationRole
      Returns:
      the total number of seats of this ApplicationRole issued with the licence.

    • isSelectedByDefault

      public boolean isSelectedByDefault()
      Description copied from interface: ApplicationRole
      Determines whether ApplicationRole should be selected by default on user creation
      Specified by:
      isSelectedByDefault in interface ApplicationRole
      Returns:
      true when ApplicationRole should be selected by default on user creation
    • isDefined

      public boolean isDefined()
      Description copied from interface: ApplicationRole
      Indicates if the Application/Product is defined. This is true when the ApplicationRoleDefinition identified by the ApplicationKey is defined. An ApplicationRole is defined when the JIRA plugin that defines it is installed.
      Specified by:
      isDefined in interface ApplicationRole
      Returns:
      true if the ApplicationRole is defined
    • isPlatform

      public boolean isPlatform()
      Description copied from interface: ApplicationRole
      Returns whether the role is part of the core platform.
      Specified by:
      isPlatform in interface ApplicationRole
      Returns:
      true if the application role is part of the core platform, false if it comes from elsewhere such as a plugin.
    • withSelectedByDefault

      public ApplicationRole withSelectedByDefault(boolean selectedByDefault)
      Description copied from interface: ApplicationRole
      Returns a new ApplicationRole with its selected by default settings set to passed value
      Specified by:
      withSelectedByDefault in interface ApplicationRole
      Parameters:
      selectedByDefault - the new selected by default settings
      Returns:
      a new ApplicationRole with its selected by default settings set to passed value
    • copy

      public MockApplicationRole copy()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object