Package org.commonjava.test.http.expect
Class ExpectationServer
- java.lang.Object
-
- org.commonjava.test.http.expect.ExpectationServer
-
- All Implemented Interfaces:
HttpServerFixture<ExpectationServer>
public class ExpectationServer extends Object implements HttpServerFixture<ExpectationServer>
-
-
Constructor Summary
Constructors Constructor Description ExpectationServer()ExpectationServer(int port)ExpectationServer(String baseResource)ExpectationServer(String baseResource, int port)
-
Method Summary
-
-
-
Method Detail
-
getPort
public int getPort()
-
stop
public void stop()
- Specified by:
stopin interfaceHttpServerFixture<ExpectationServer>
-
start
public ExpectationServer start()
- Specified by:
startin interfaceHttpServerFixture<ExpectationServer>
-
getBaseUri
public String getBaseUri()
-
getUrlPath
public String getUrlPath(String url) throws MalformedURLException
- Throws:
MalformedURLException
-
getRegisteredErrors
public Map<String,ContentResponse> getRegisteredErrors()
-
registerException
public void registerException(String method, String url, int responseCode, String error)
-
expect
public void expect(String testUrl, int responseCode, String body) throws Exception
- Throws:
Exception
-
expect
public void expect(String method, String testUrl, int responseCode, String body) throws Exception
- Throws:
Exception
-
expect
public void expect(String testUrl, int responseCode, InputStream bodyStream) throws Exception
- Throws:
Exception
-
expect
public void expect(String method, String testUrl, int responseCode, InputStream bodyStream) throws Exception
- Throws:
Exception
-
expect
public void expect(String method, String testUrl, ExpectationHandler handler)
-
getAccessKey
public String getAccessKey(CommonMethod method, String path)
-
-