Class MockHttp<R extends jakarta.servlet.http.HttpServletRequest,S extends jakarta.servlet.http.HttpServletResponse>

java.lang.Object
org.junit.rules.TestWatcher
com.atlassian.jira.junit.rules.MockHttp<R,S>
All Implemented Interfaces:
org.junit.rules.TestRule
Direct Known Subclasses:
MockHttp.DefaultMocks, MockHttp.MockitoMocks

public class MockHttp<R extends jakarta.servlet.http.HttpServletRequest,S extends jakarta.servlet.http.HttpServletResponse> extends org.junit.rules.TestWatcher
Sets up and tears down automatically the following, static methods used in the JIRA production code for accessing current HTTP objects:
Since:
6.0
  • Method Details

    • withMocks

      public static <RR extends jakarta.servlet.http.HttpServletRequest, RS extends jakarta.servlet.http.HttpServletResponse> MockHttp<RR,RS> withMocks(RR mockRequest, RS mockResponse)
    • withDefaultMocks

      public static MockHttp.DefaultMocks withDefaultMocks()
    • withMockitoMocks

      public static MockHttp.MockitoMocks withMockitoMocks()
    • starting

      protected void starting(org.junit.runner.Description description)
      Overrides:
      starting in class org.junit.rules.TestWatcher
    • finished

      protected void finished(org.junit.runner.Description description)
      Overrides:
      finished in class org.junit.rules.TestWatcher
    • mockRequest

      public R mockRequest()
    • mockResponse

      public S mockResponse()