OERMarketDataServiceRaw extends OERBaseService { public OERRates getOERTicker(CurrencyPair pair) throws IOException { OERTickers oERTickers = openExchangeRates.getTickers( exchange.getExchangeSpecification().getApiKey(), pair.base.toString(), pair.counter.toString()); if (oERTickers == null) { throw new ExchangeException("Null response returned from Open Exchange Rates!"); } return oERTickers.getRates(); } OERMarketDataServiceRaw(Exchange exchange); OERRates getOERTicker(CurrencyPair pair);  }
@Test public void testProxyIsCalledWithCorrectParameters() throws IOException { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(OERExchange.class); OERMarketDataServiceRaw serviceRaw = new OERMarketDataServiceRaw(exchange); OER oerMock = Mockito.mock(OER.class); OERTickers tickers = new OERTickers(new OERRates(), 0L); tickers.getRates().setAUD(1.23d); Mockito.when(oerMock.getTickers(null, Currency.USD.toString(), Currency.AUD.toString())) .thenReturn(tickers); Whitebox.setInternalState(serviceRaw, "openExchangeRates", oerMock); serviceRaw.getOERTicker(CurrencyPair.USD_AUD); Mockito.verify(oerMock).getTickers(null, Currency.USD.toString(), Currency.AUD.toString()); }