Class MockQueueItemAuthenticator

  • All Implemented Interfaces:
    hudson.ExtensionPoint, hudson.model.Describable<jenkins.security.QueueItemAuthenticator>

    public final class MockQueueItemAuthenticator
    extends jenkins.security.QueueItemAuthenticator
    Allows testing of anything related to QueueItemAuthenticator. To use, call QueueItemAuthenticatorConfiguration.get() (or Inject it), then call QueueItemAuthenticatorConfiguration.getAuthenticators() and add an instance of this.
    • Constructor Detail

      • MockQueueItemAuthenticator

        public MockQueueItemAuthenticator​(Map<String,​org.acegisecurity.Authentication> jobsToUsers)
        Creates a new authenticator.
        Parameters:
        jobsToUsers - a map from Item.getFullName() to authentications such as from User.impersonate()
    • Method Detail

      • authenticate

        public org.acegisecurity.Authentication authenticate​(hudson.model.Queue.Item item)
        Overrides:
        authenticate in class jenkins.security.QueueItemAuthenticator