Package jetbrains.buildServer.http
Class FakeHttpApi
- java.lang.Object
-
- jetbrains.buildServer.http.FakeHttpApi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FakeHttpApi.NotFound
static class
FakeHttpApi.SimpleResponse
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.http.HttpApi
HttpApi.HeaderPair, HttpApi.Response
-
-
Constructor Summary
Constructors Constructor Description FakeHttpApi()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBlockedUri(String path)
void
addCookie(String cookieName, String cookieValue, String domain, int maxAgeSeconds)
void
addNotFoundPath(String path)
void
addOneTimePredefinedResponse(String path, HttpApi.Response response)
void
addPredefinedResponse(String path, HttpApi.Response response)
void
breakConnectionAfterCurrentRequestsEnd()
void
breakConnectionImmediately()
void
clearPredefinedResponses()
HttpApi.Response
get(String uri, HttpApi.HeaderPair... headers)
String
getCookieValue(String cookieName)
HttpApi.Response
post(String uri, String body, String contentType, String charset, HttpApi.HeaderPair... headers)
void
resetCookies()
void
restoreConnection()
void
setDelegate(HttpApi delegate)
-
-
-
Method Detail
-
setDelegate
public void setDelegate(@NotNull HttpApi delegate)
-
get
@NotNull public HttpApi.Response get(@NotNull String uri, @NotNull HttpApi.HeaderPair... headers) throws IOException
- Specified by:
get
in interfaceHttpApi
- Throws:
IOException
-
post
@NotNull public HttpApi.Response post(@NotNull String uri, @NotNull String body, @NotNull String contentType, @NotNull String charset, @NotNull HttpApi.HeaderPair... headers) throws IOException
- Specified by:
post
in interfaceHttpApi
- Throws:
IOException
-
addCookie
public void addCookie(@NotNull String cookieName, @NotNull String cookieValue, @NotNull String domain, int maxAgeSeconds)
-
resetCookies
public void resetCookies()
-
breakConnectionImmediately
public void breakConnectionImmediately()
-
breakConnectionAfterCurrentRequestsEnd
public void breakConnectionAfterCurrentRequestsEnd()
-
addBlockedUri
public void addBlockedUri(@NotNull String path)
-
addNotFoundPath
public void addNotFoundPath(@NotNull String path)
-
addPredefinedResponse
public void addPredefinedResponse(@NotNull String path, @NotNull HttpApi.Response response)
-
addOneTimePredefinedResponse
public void addOneTimePredefinedResponse(@NotNull String path, @NotNull HttpApi.Response response)
-
clearPredefinedResponses
public void clearPredefinedResponses()
-
restoreConnection
public void restoreConnection()
-
-