Package fr.gouv.vitam.common.client
Class AbstractMockClient
- java.lang.Object
-
- fr.gouv.vitam.common.client.AbstractMockClient
-
- All Implemented Interfaces:
MockOrRestClient
,VitamAutoCloseable
,java.lang.AutoCloseable
- Direct Known Subclasses:
AdminManagementClientMock
,CollectInternalClientRestMock
,IngestInternalClientMock
,LogbookOperationsClientMock
,MetaDataClientMock
,ProcessingManagementClientMock
,StorageClientMock
public class AbstractMockClient extends java.lang.Object implements MockOrRestClient
Abstract Mock common client
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractMockClient.FakeInboundResponse
Fake Inbound Response for Mock client support
-
Constructor Summary
Constructors Constructor Description AbstractMockClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkStatus()
Check the status from the servicevoid
checkStatus(javax.ws.rs.core.MultivaluedHashMap<java.lang.String,java.lang.Object> headers)
Check the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificatevoid
close()
Close the underneath http clientvoid
consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
Helper when an error occurs on client usage side to consume response howeverjava.lang.String
getResourcePath()
Get the resource path of the server.java.lang.String
getServiceUrl()
Get the service URL
-
-
-
Method Detail
-
checkStatus
public void checkStatus()
Description copied from interface:MockOrRestClient
Check the status from the service- Specified by:
checkStatus
in interfaceMockOrRestClient
-
checkStatus
public void checkStatus(javax.ws.rs.core.MultivaluedHashMap<java.lang.String,java.lang.Object> headers) throws VitamApplicationServerException
Description copied from interface:MockOrRestClient
Check the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificate- Specified by:
checkStatus
in interfaceMockOrRestClient
- Throws:
VitamApplicationServerException
- if the Server is unavailable
-
close
public void close()
Description copied from interface:MockOrRestClient
Close the underneath http client- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceMockOrRestClient
- Specified by:
close
in interfaceVitamAutoCloseable
-
getResourcePath
public java.lang.String getResourcePath()
Description copied from interface:MockOrRestClient
Get the resource path of the server.- Specified by:
getResourcePath
in interfaceMockOrRestClient
- Returns:
- the resource path as string
-
getServiceUrl
public java.lang.String getServiceUrl()
Description copied from interface:MockOrRestClient
Get the service URL- Specified by:
getServiceUrl
in interfaceMockOrRestClient
- Returns:
- the service URL
-
consumeAnyEntityAndClose
public void consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
Description copied from interface:MockOrRestClient
Helper when an error occurs on client usage side to consume response however- Specified by:
consumeAnyEntityAndClose
in interfaceMockOrRestClient
-
-