Package hudson.cli
Class CLICommandInvoker
- java.lang.Object
-
- hudson.cli.CLICommandInvoker
-
public class CLICommandInvoker extends Object
Helper class to invokeCLICommand
and check the response.- Author:
- ogondza
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CLICommandInvoker.Matcher
static class
CLICommandInvoker.Result
-
Constructor Summary
Constructors Constructor Description CLICommandInvoker(JenkinsRule rule, hudson.cli.CLICommand command)
CLICommandInvoker(JenkinsRule rule, String command)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CLICommandInvoker
asUser(String user)
Run the command as a given username.CLICommandInvoker
authorizedTo(hudson.security.Permission... permissions)
Deprecated.Rather useasUser(java.lang.String)
.CLICommandInvoker.Result
invoke()
CLICommandInvoker.Result
invokeWithArgs(String... args)
hudson.model.User
user()
Deprecated.only used withauthorizedTo(hudson.security.Permission...)
CLICommandInvoker
withArgs(String... args)
CLICommandInvoker
withStdin(InputStream stdin)
-
-
-
Constructor Detail
-
CLICommandInvoker
public CLICommandInvoker(JenkinsRule rule, hudson.cli.CLICommand command)
-
CLICommandInvoker
public CLICommandInvoker(JenkinsRule rule, String command)
-
-
Method Detail
-
authorizedTo
@Deprecated public CLICommandInvoker authorizedTo(hudson.security.Permission... permissions)
Deprecated.Rather useasUser(java.lang.String)
.
-
asUser
public CLICommandInvoker asUser(String user)
Run the command as a given username. Test setup should have first defined a meaningful security realm and authorization strategy.- See Also:
Jenkins.setSecurityRealm(hudson.security.SecurityRealm)
,JenkinsRule.createDummySecurityRealm()
,Jenkins.setAuthorizationStrategy(hudson.security.AuthorizationStrategy)
,MockAuthorizationStrategy
-
withStdin
public CLICommandInvoker withStdin(InputStream stdin)
-
withArgs
public CLICommandInvoker withArgs(String... args)
-
invokeWithArgs
public CLICommandInvoker.Result invokeWithArgs(String... args)
-
invoke
public CLICommandInvoker.Result invoke()
-
user
@Deprecated public hudson.model.User user()
Deprecated.only used withauthorizedTo(hudson.security.Permission...)
-
-