Package io.fabric8.mockwebserver
Class MockWebServer
- java.lang.Object
-
- io.fabric8.mockwebserver.MockWebServer
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MockWebServer extends Object implements Closeable
-
-
Constructor Summary
Constructors Constructor Description MockWebServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(MockWebServerListener listener)voidclose()voidenqueue(MockResponse response)StringgetHostName()intgetPort()intgetRequestCount()io.vertx.core.net.SelfSignedCertificategetSelfSignedCertificate()voidreset()Returns the MockWebServer to its initial state by: Clearing the request count. Clearing the request queue.voidsetDispatcher(Dispatcher dispatcher)voidsetProtocols(List<Protocol> protocols)voidshutdown()voidstart()voidstart(int port)voidstart(InetAddress inetAddress, int port)RecordedRequesttakeRequest()RecordedRequesttakeRequest(long timeout, TimeUnit unit)ProxytoProxyAddress()StringtoString()HttpUrlurl(String path)voiduseHttps()
-
-
-
Method Detail
-
start
public void start()
-
start
public void start(int port)
-
start
public void start(InetAddress inetAddress, int port)
-
shutdown
public void shutdown()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getPort
public int getPort()
-
getHostName
public String getHostName()
-
toProxyAddress
public Proxy toProxyAddress()
-
getSelfSignedCertificate
public io.vertx.core.net.SelfSignedCertificate getSelfSignedCertificate()
-
takeRequest
public RecordedRequest takeRequest() throws InterruptedException
- Throws:
InterruptedException
-
takeRequest
public RecordedRequest takeRequest(long timeout, TimeUnit unit) throws InterruptedException
- Throws:
InterruptedException
-
getRequestCount
public int getRequestCount()
-
useHttps
public void useHttps()
-
enqueue
public void enqueue(MockResponse response)
-
addListener
public void addListener(MockWebServerListener listener)
-
setDispatcher
public void setDispatcher(Dispatcher dispatcher)
-
reset
public final void reset()
Returns the MockWebServer to its initial state by:- Clearing the request count.
- Clearing the request queue.
-
-