Package no.digipost.api.client.testing
Class DigipostApiMock
- java.lang.Object
-
- no.digipost.api.client.testing.DigipostApiMock
-
- All Implemented Interfaces:
io.undertow.server.HttpHandler
public class DigipostApiMock extends java.lang.Object implements io.undertow.server.HttpHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DigipostApiMock.ContentPart
static class
DigipostApiMock.DigipostRequest
static class
DigipostApiMock.Method
static class
DigipostApiMock.MockRequest
static class
DigipostApiMock.MockResponse
class
DigipostApiMock.MultipartRequestMatcher
static interface
DigipostApiMock.RequestMatcher
static class
DigipostApiMock.RequestsAndResponses
static interface
DigipostApiMock.ResponseProducer
-
Field Summary
Fields Modifier and Type Field Description org.apache.http.client.methods.CloseableHttpResponse
defaultResponse
-
Constructor Summary
Constructors Constructor Description DigipostApiMock(java.time.Clock clock)
-
Method Summary
Modifier and Type Method Description static org.apache.http.client.methods.CloseableHttpResponse
getDefaultResponse(java.time.Clock clock)
void
handleRequest(io.undertow.server.HttpServerExchange httpContext)
void
init()
DigipostApiMock
start(int port, java.util.Map<DigipostApiMock.Method,DigipostApiMock.RequestsAndResponses> requestsAndResponsesMap, java.security.KeyPair keyPair)
void
stop()
-
-
-
Method Detail
-
handleRequest
public void handleRequest(io.undertow.server.HttpServerExchange httpContext) throws java.lang.Exception
- Specified by:
handleRequest
in interfaceio.undertow.server.HttpHandler
- Throws:
java.lang.Exception
-
start
public DigipostApiMock start(int port, java.util.Map<DigipostApiMock.Method,DigipostApiMock.RequestsAndResponses> requestsAndResponsesMap, java.security.KeyPair keyPair)
-
stop
public void stop()
-
init
public void init()
-
getDefaultResponse
public static org.apache.http.client.methods.CloseableHttpResponse getDefaultResponse(java.time.Clock clock)
-
-