CoinjarAdapters { public static Order.OrderStatus adaptStatus(String status) { if (status.equals("booked")) { return Order.OrderStatus.PENDING_NEW; } else if (status.equals("filled")) { return Order.OrderStatus.FILLED; } else if (status.equals("cancelled")) { return Order.OrderStatus.CANCELED; } else { logger.warn("Unable to convert remote status {} to Order.OrderStatus", status); return Order.OrderStatus.UNKNOWN; } } private  CoinjarAdapters(); static String currencyPairToProduct(CurrencyPair pair); static CurrencyPair productToCurrencyPair(String product); static String orderTypeToBuySell(Order.OrderType orderType); static Order.OrderType buySellToOrderType(String buySell); static Order.OrderStatus adaptStatus(String status); static Ticker adaptTicker(CoinjarTicker ticker, CurrencyPair currencyPair); static LimitOrder adaptOrderToLimitOrder(CoinjarOrder coinjarOrder); static UserTrade adaptOrderToUserTrade(CoinjarOrder order); static OrderBook adaptOrderbook(CoinjarOrderBook orderBook, CurrencyPair currencyPair); static UserTrade adaptFillToUserTrade(CoinjarFill coinjarFill);  }
@Test public void testAdaptStatus() { assertThat(CoinjarAdapters.adaptStatus("filled")).isEqualTo(Order.OrderStatus.FILLED); assertThat(CoinjarAdapters.adaptStatus("booked")).isEqualTo(Order.OrderStatus.PENDING_NEW); }