|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.kristofa.test.http.MockHttpServer
public class MockHttpServer
| Nested Class Summary | |
|---|---|
class |
MockHttpServer.ExpectationHandler
|
| Field Summary | |
|---|---|
static String |
DELETE
|
static String |
GET
|
static String |
POST
|
static String |
PUT
|
| Constructor Summary | |
|---|---|
MockHttpServer(int port,
HttpResponseProvider responseProvider)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
setExceptionResponseCode(int code)
Allows to set a custom response code to be returned when an unexpected exception happens. |
void |
setNoMatchFoundResponseCode(int code)
Allows you to set a custom response code to be returned when no matching response is found. |
void |
start()
Starts the server. |
void |
stop()
Closes the server. |
void |
verify()
Verify if we got all requests as expected. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GET
public static final String POST
public static final String PUT
public static final String DELETE
| Constructor Detail |
|---|
public MockHttpServer(int port,
HttpResponseProvider responseProvider)
port - Port on which mock server should operate.responseProvider - HttpResponseProvider. Should not be null.| Method Detail |
|---|
public void start()
throws IOException
IOException - In case starting fails.
public void stop()
throws IOException
IOException - In case closing fails.
public void verify()
throws UnsatisfiedExpectationException
UnsatisfiedExpectationException - In case we got unexpected requests or we did not get all requests we expected.public void setNoMatchFoundResponseCode(int code)
code - HTTP response code to return when no matching response is found.public void setExceptionResponseCode(int code)
code - HTTP response code to return when an unexpected exception happens.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||