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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Map<String, List<Message>> getExchanges()
      final Unit setExchanges(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.
      Rfq getRfq(String exchangeId) Returns an Rfq associated with the specified exchange ID.
      Quote getQuote(String exchangeId) Returns a Quote associated with the specified exchange ID.
      Order getOrder(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.
      Close getClose(String exchangeId) Returns a Close associated with the specified exchange ID.
      final Unit addMessage(Message message) Adds a Message to the mock exchanges.
      final Unit resetExchanges() Resets the mock exchanges, clearing all stored messages.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FakeExchangesApi

        FakeExchangesApi()
    • Method Detail

      • 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.