Class CollectClientMock
- java.lang.Object
-
- fr.gouv.vitam.common.external.client.AbstractMockClient
-
- fr.gouv.vitam.collect.external.client.CollectClientMock
-
- All Implemented Interfaces:
CollectClient
,MockOrRestClient
,VitamAutoCloseable
,java.lang.AutoCloseable
public class CollectClientMock extends AbstractMockClient implements CollectClient
Collect Client implementation for integration tests
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.gouv.vitam.common.external.client.AbstractMockClient
AbstractMockClient.FakeInboundResponse
-
-
Constructor Summary
Constructors Constructor Description CollectClientMock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
addBinary(java.lang.String unitId, java.lang.String usage, java.lang.Integer version, java.io.InputStream inputStreamUploaded)
ADD Binary Consume and produce MediaType.APPLICATION_JSONRequestResponseOK<com.fasterxml.jackson.databind.JsonNode>
addObjectGroup(java.lang.String unitId, java.lang.String usage, java.lang.Integer version, com.fasterxml.jackson.databind.JsonNode objectJsonNode)
ADD Object Group Consume and produce MediaType.APPLICATION_JSONjavax.ws.rs.core.Response
closeTransaction(java.lang.String transactionId)
Close Transaction Consume and produce MediaType.APPLICATION_JSONRequestResponseOK<com.fasterxml.jackson.databind.JsonNode>
ingest(java.lang.String transactionId)
Generate SIP + Send to Vitam Consume and produce MediaType.APPLICATION_JSONRequestResponse<com.fasterxml.jackson.databind.JsonNode>
initTransaction(TransactionDto transactionDto)
Initialize a collect transaction Consume and produce MediaType.APPLICATION_JSONRequestResponseOK<com.fasterxml.jackson.databind.JsonNode>
uploadArchiveUnit(java.lang.String transactionId, com.fasterxml.jackson.databind.JsonNode unitJsonNode)
ADD Archive Unit Consume and produce MediaType.APPLICATION_JSON-
Methods inherited from class fr.gouv.vitam.common.external.client.AbstractMockClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
-
-
-
Method Detail
-
initTransaction
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> initTransaction(TransactionDto transactionDto) throws InvalidParseOperationException
Description copied from interface:CollectClient
Initialize a collect transaction Consume and produce MediaType.APPLICATION_JSON- Specified by:
initTransaction
in interfaceCollectClient
- Returns:
- RequestResponse
guid created for the transaction - Throws:
InvalidParseOperationException
- exception occurs when parse operation failed
-
uploadArchiveUnit
public RequestResponseOK<com.fasterxml.jackson.databind.JsonNode> uploadArchiveUnit(java.lang.String transactionId, com.fasterxml.jackson.databind.JsonNode unitJsonNode) throws InvalidParseOperationException
Description copied from interface:CollectClient
ADD Archive Unit Consume and produce MediaType.APPLICATION_JSON- Specified by:
uploadArchiveUnit
in interfaceCollectClient
- Returns:
- RequestResponse
Archive Unit saved - Throws:
InvalidParseOperationException
- exception occurs when parse operation failed
-
addObjectGroup
public RequestResponseOK<com.fasterxml.jackson.databind.JsonNode> addObjectGroup(java.lang.String unitId, java.lang.String usage, java.lang.Integer version, com.fasterxml.jackson.databind.JsonNode objectJsonNode) throws InvalidParseOperationException
Description copied from interface:CollectClient
ADD Object Group Consume and produce MediaType.APPLICATION_JSON- Specified by:
addObjectGroup
in interfaceCollectClient
- Returns:
- RequestResponse
Archive Unit saved - Throws:
InvalidParseOperationException
- exception occurs when parse operation failed
-
addBinary
public javax.ws.rs.core.Response addBinary(java.lang.String unitId, java.lang.String usage, java.lang.Integer version, java.io.InputStream inputStreamUploaded) throws InvalidParseOperationException
Description copied from interface:CollectClient
ADD Binary Consume and produce MediaType.APPLICATION_JSON- Specified by:
addBinary
in interfaceCollectClient
- Returns:
- RequestResponse
Archive Unit saved - Throws:
InvalidParseOperationException
- exception occurs when parse operation failed
-
closeTransaction
public javax.ws.rs.core.Response closeTransaction(java.lang.String transactionId) throws InvalidParseOperationException
Description copied from interface:CollectClient
Close Transaction Consume and produce MediaType.APPLICATION_JSON- Specified by:
closeTransaction
in interfaceCollectClient
- Returns:
- RequestResponse
Archive Unit saved - Throws:
InvalidParseOperationException
- exception occurs when parse operation failed
-
ingest
public RequestResponseOK<com.fasterxml.jackson.databind.JsonNode> ingest(java.lang.String transactionId) throws InvalidParseOperationException
Description copied from interface:CollectClient
Generate SIP + Send to Vitam Consume and produce MediaType.APPLICATION_JSON- Specified by:
ingest
in interfaceCollectClient
- Returns:
- RequestResponse
Archive Unit saved - Throws:
InvalidParseOperationException
- exception occurs when parse operation failed
-
-