Package com.atlassian.jira.junit.rules
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:
ActionContext
ExecutingHttpRequest
- Since:
- 6.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
finished
(org.junit.runner.Description description) protected void
starting
(org.junit.runner.Description description) static MockHttp.DefaultMocks
static MockHttp.MockitoMocks
static <RR extends jakarta.servlet.http.HttpServletRequest,
RS extends jakarta.servlet.http.HttpServletResponse>
MockHttp<RR, RS> withMocks
(RR mockRequest, RS mockResponse) Methods inherited from class org.junit.rules.TestWatcher
apply, failed, skipped, skipped, succeeded
-
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
-
withMockitoMocks
-
starting
protected void starting(org.junit.runner.Description description) - Overrides:
starting
in classorg.junit.rules.TestWatcher
-
finished
protected void finished(org.junit.runner.Description description) - Overrides:
finished
in classorg.junit.rules.TestWatcher
-
mockRequest
-
mockResponse
-