public class MockAndProxyFacade extends Object
LoggingHttpProxy for using real services and logging
requests/responses or the MockHttpServer for running your code against mocked http requests/responses. You
can use MockHttpServer or LoggingHttpProxy by themselves but if you use both it is most likely that this
class will make things easier for you.| Modifier and Type | Class and Description |
|---|---|
static class |
MockAndProxyFacade.Builder |
static class |
MockAndProxyFacade.Mode
Specifies the mode in which
MockAndProxyFacade should be operating. |
| Modifier and Type | Method and Description |
|---|---|
void |
start()
Starts either
MockHttpServer or LoggingHttpProxy depending on operation mode. |
void |
stop()
Stops either
MockHttpServer or LoggingHttpProxy depending on operation mode. |
void |
verify()
In case we are in Mocking operation mode we will verify if all expected requests have been invoked.
|
public void start()
throws IOException
MockHttpServer or LoggingHttpProxy depending on operation mode.IOException - In case starting fails.public void stop()
throws IOException
MockHttpServer or LoggingHttpProxy depending on operation mode.IOException - In case stopping fails.public void verify()
throws UnsatisfiedExpectationException
UnsatisfiedExpectationException - In case we got unexpected requests and/or not all expected requests were
invoked.Copyright © 2014. All Rights Reserved.