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 classDigipostApiMock.ContentPartstatic classDigipostApiMock.DigipostRequeststatic classDigipostApiMock.Methodstatic classDigipostApiMock.MockRequeststatic classDigipostApiMock.MockResponseclassDigipostApiMock.MultipartRequestMatcherstatic interfaceDigipostApiMock.RequestMatcherstatic classDigipostApiMock.RequestsAndResponsesstatic interfaceDigipostApiMock.ResponseProducer
-
Field Summary
Fields Modifier and Type Field Description org.apache.http.client.methods.CloseableHttpResponsedefaultResponse
-
Constructor Summary
Constructors Constructor Description DigipostApiMock(java.time.Clock clock)
-
Method Summary
Modifier and Type Method Description static org.apache.http.client.methods.CloseableHttpResponsegetDefaultResponse(java.time.Clock clock)voidhandleRequest(io.undertow.server.HttpServerExchange httpContext)voidinit()DigipostApiMockstart(int port, java.util.Map<DigipostApiMock.Method,DigipostApiMock.RequestsAndResponses> requestsAndResponsesMap, java.security.KeyPair keyPair)voidstop()
-
-
-
Method Detail
-
handleRequest
public void handleRequest(io.undertow.server.HttpServerExchange httpContext) throws java.lang.Exception- Specified by:
handleRequestin 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)
-
-