Class GroovyJenkinsRule

java.lang.Object
org.jvnet.hudson.test.JenkinsRule
org.jvnet.hudson.test.GroovyJenkinsRule
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.ModelObject, hudson.model.RootAction, org.junit.rules.MethodRule, org.junit.rules.TestRule

public class GroovyJenkinsRule extends JenkinsRule
JenkinsRule variant with special options for tests written in Groovy.
Since:
1.535
  • Constructor Details

    • GroovyJenkinsRule

      public GroovyJenkinsRule()
  • Method Details

    • executeOnServer

      public Object executeOnServer(groovy.lang.Closure<?> c) throws Exception
      Executes the given closure on the server, in the context of an HTTP request. This is useful for testing some methods that require StaplerRequest2 and StaplerResponse2.

      The closure will get the request and response as parameters.

      Throws:
      Exception
    • builder

      public hudson.tasks.Builder builder(groovy.lang.Closure<?> c)
      Wraps a closure as a Builder.