Class FakeExchangesApi
-
- All Implemented Interfaces:
-
tbdex.sdk.httpserver.models.ExchangesApi
public final class FakeExchangesApi implements ExchangesApi
A fake implementation of the ExchangesApi interface for testing purposes. This class provides mock implementations for various methods.
-
-
Constructor Summary
Constructors Constructor Description FakeExchangesApi()
-
Method Summary
Modifier and Type Method Description final Map<String, List<Message>>getExchanges()final UnitsetExchanges(Map<String, List<Message>> exchanges)List<Message>getExchange(String id, String requesterDid)Returns a list of Message representing the exchange with the specified ID. List<List<Message>>getExchanges(GetExchangesFilter filter)Returns a list of lists of Message representing exchanges based on the provided filter. RfqgetRfq(String exchangeId)Returns an Rfq associated with the specified exchange ID. QuotegetQuote(String exchangeId)Returns a Quote associated with the specified exchange ID. OrdergetOrder(String exchangeId)Returns an Order associated with the specified exchange ID. List<OrderStatus>getOrderStatuses(String exchangeId)Returns a list of OrderStatus associated with the specified exchange ID. ClosegetClose(String exchangeId)Returns a Close associated with the specified exchange ID. final UnitaddMessage(Message message)Adds a Message to the mock exchanges. final UnitresetExchanges()Resets the mock exchanges, clearing all stored messages. -
-
Method Detail
-
getExchanges
final Map<String, List<Message>> getExchanges()
-
setExchanges
final Unit setExchanges(Map<String, List<Message>> exchanges)
-
getExchange
List<Message> getExchange(String id, String requesterDid)
Returns a list of Message representing the exchange with the specified ID.
- Parameters:
id- The exchange ID to retrieve.requesterDid- the DID of the requester.- Returns:
A list of Message representing exchanges with the specified ID(s), or null if not found.
-
getExchanges
List<List<Message>> getExchanges(GetExchangesFilter filter)
Returns a list of lists of Message representing exchanges based on the provided filter.
- Parameters:
filter- The filter criteria for retrieving exchanges.- Returns:
A list of lists of Message representing exchanges based on the filter, or null if none are found.
-
getRfq
Rfq getRfq(String exchangeId)
Returns an Rfq associated with the specified exchange ID.
- Parameters:
exchangeId- The ID of the exchange associated with the RFQ.- Returns:
An Rfq associated with the specified exchange, or null if not found.
-
getQuote
Quote getQuote(String exchangeId)
Returns a Quote associated with the specified exchange ID.
- Parameters:
exchangeId- The ID of the exchange associated with the Quote.- Returns:
A Quote associated with the specified exchange, or null if not found.
-
getOrder
Order getOrder(String exchangeId)
Returns an Order associated with the specified exchange ID.
- Parameters:
exchangeId- The ID of the exchange associated with the Order.- Returns:
An Order associated with the specified exchange, or null if not found.
-
getOrderStatuses
List<OrderStatus> getOrderStatuses(String exchangeId)
Returns a list of OrderStatus associated with the specified exchange ID.
- Parameters:
exchangeId- The ID of the exchange associated with the OrderStatus entities.- Returns:
A list of OrderStatus associated with the specified exchange, or null if none are found.
-
getClose
Close getClose(String exchangeId)
Returns a Close associated with the specified exchange ID.
- Parameters:
exchangeId- The ID of the exchange associated with the Close entity.- Returns:
A Close associated with the specified exchange, or null if not found.
-
addMessage
final Unit addMessage(Message message)
Adds a Message to the mock exchanges.
- Parameters:
message- The Message to be added.
-
resetExchanges
final Unit resetExchanges()
Resets the mock exchanges, clearing all stored messages.
-
-
-
-