test_class.declarator: HISTO_AAPL = readFile("/provider/rate/yahoo/histo_aapl.json")
test_class.modifier: private static final
test_class.original_string: private static final String HISTO_AAPL = readFile("/provider/rate/yahoo/histo_aapl.json");
test_class.type: String
test_class.var_name: HISTO_AAPL
test_class.declarator: LATEST = readFile("/provider/rate/yahoo/latest.json")
test_class.modifier: private static final
test_class.original_string: private static final String LATEST = readFile("/provider/rate/yahoo/latest.json");
test_class.type: String
test_class.var_name: LATEST
test_class.declarator: LATEST_UBI = readFile("/provider/rate/yahoo/latest_ubi.json")
test_class.modifier: private static final
test_class.original_string: private static final String LATEST_UBI = readFile("/provider/rate/yahoo/latest_ubi.json");
test_class.type: String
test_class.var_name: LATEST_UBI
test_class.declarator: pairService
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private PairService pairService;
test_class.type: PairService
test_class.var_name: pairService
test_class.declarator: yahooStock
test_class.modifier: @InjectMocks
  	private
test_class.original_string: @InjectMocks
  	private YahooStockProvider yahooStock;
test_class.type: YahooStockProvider
test_class.var_name: yahooStock
test_class.declarator: server
test_class.modifier: private
test_class.original_string: private MockRestServiceServer server;
test_class.type: MockRestServiceServer
test_class.var_name: server
test_class.file: trading-common/src/test/java/fr/ymanvieu/trading/common/provider/rate/yahoo/YahooStockProviderTest.java
test_class.identifier: YahooStockProviderTest
test_case.body: @Test
  	public void testGetLatestRate() {
  		server.expect(anything()).andRespond(withSuccess(LATEST_UBI, MediaType.APPLICATION_JSON));
  
  		Quote result = yahooStock.getLatestRate("UBI.PA");
  
  		assertThat(result).isEqualTo(new Quote("UBI.PA", null, new BigDecimal("57.52"), parse("2017-09-08T17:35:14+02:00")));
  	}
test_case.class_method_signature: YahooStockProviderTest.testGetLatestRate()
test_case.full_signature: @Test public void testGetLatestRate()
test_case.identifier: testGetLatestRate
test_case.invocations: andRespond expect anything withSuccess getLatestRate isEqualTo assertThat parse
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetLatestRate()
focal_class.declarator: rt = new RestTemplate()
focal_class.modifier: private final
focal_class.original_string: private final RestTemplate rt = new RestTemplate();
focal_class.type: RestTemplate
focal_class.var_name: rt
focal_class.declarator: url
focal_class.modifier: @Value("${provider.yahoo.url.latest}")
  	private
focal_class.original_string: @Value("${provider.yahoo.url.latest}")
  	private String url;
focal_class.type: String
focal_class.var_name: url
focal_class.declarator: urlHistory
focal_class.modifier: @Value("${provider.yahoo.url.history}")
  	private
focal_class.original_string: @Value("${provider.yahoo.url.history}")
  	private String urlHistory;
focal_class.type: String
focal_class.var_name: urlHistory
focal_class.declarator: pairService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private PairService pairService;
focal_class.type: PairService
focal_class.var_name: pairService
focal_class.file: trading-common/src/main/java/fr/ymanvieu/trading/common/provider/rate/yahoo/YahooStockProvider.java
focal_class.identifier: YahooStockProvider
focal_class.interfaces: implements LatestRateProvider, HistoricalRateProvider
focal_class.class_method_signature: YahooStockProvider.getRates()
focal_class.full_signature: @Override public List<Quote> getRates()
focal_class.identifier: getRates
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Quote>
focal_class.signature: List<Quote> getRates()
focal_class.class_method_signature: YahooStockProvider.toInstant(long secondsTimestamp)
focal_class.full_signature: private static Instant toInstant(long secondsTimestamp)
focal_class.identifier: toInstant
focal_class.modifiers: private static
focal_class.parameters: (long secondsTimestamp)
focal_class.return: Instant
focal_class.signature: Instant toInstant(long secondsTimestamp)
focal_class.class_method_signature: YahooStockProvider.getLatestRate(String symbol)
focal_class.full_signature: @Override public Quote getLatestRate(String symbol)
focal_class.identifier: getLatestRate
focal_class.modifiers: @Override public
focal_class.parameters: (String symbol)
focal_class.return: Quote
focal_class.signature: Quote getLatestRate(String symbol)
focal_class.class_method_signature: YahooStockProvider.getHistoricalRates()
focal_class.full_signature: @Override public List<Quote> getHistoricalRates()
focal_class.identifier: getHistoricalRates
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Quote>
focal_class.signature: List<Quote> getHistoricalRates()
focal_class.class_method_signature: YahooStockProvider.getHistoricalRates(String code)
focal_class.full_signature: @Override public List<Quote> getHistoricalRates(String code)
focal_class.identifier: getHistoricalRates
focal_class.modifiers: @Override public
focal_class.parameters: (String code)
focal_class.return: List<Quote>
focal_class.signature: List<Quote> getHistoricalRates(String code)
focal_class.class_method_signature: YahooStockProvider.getCurrency(List<Pair> symbols, String symbol)
focal_class.full_signature: private String getCurrency(List<Pair> symbols, String symbol)
focal_class.identifier: getCurrency
focal_class.modifiers: private
focal_class.parameters: (List<Pair> symbols, String symbol)
focal_class.return: String
focal_class.signature: String getCurrency(List<Pair> symbols, String symbol)
focal_class.class_method_signature: YahooStockProvider.getSource(List<Pair> symbols, String symbol)
focal_class.full_signature: private String getSource(List<Pair> symbols, String symbol)
focal_class.identifier: getSource
focal_class.modifiers: private
focal_class.parameters: (List<Pair> symbols, String symbol)
focal_class.return: String
focal_class.signature: String getSource(List<Pair> symbols, String symbol)
focal_class.class_method_signature: YahooStockProvider.createPairsString(List<Pair> symbols)
focal_class.full_signature: private String createPairsString(List<Pair> symbols)
focal_class.identifier: createPairsString
focal_class.modifiers: private
focal_class.parameters: (List<Pair> symbols)
focal_class.return: String
focal_class.signature: String createPairsString(List<Pair> symbols)
focal_method.body: @Override
  	public Quote getLatestRate(String symbol) {
  		YahooModel result = rt.getForObject(format(url, symbol), YahooModel.class);
  
  		return result
  				.getQuoteResponse().getResult().stream().map(yf -> new Quote(yf.getSymbol(),
  						BigDecimal.valueOf(yf.getRegularMarketPrice()), toInstant(yf.getRegularMarketTime())))
  				.findFirst().orElse(null);
  	}
focal_method.class_method_signature: YahooStockProvider.getLatestRate(String symbol)
focal_method.full_signature: @Override public Quote getLatestRate(String symbol)
focal_method.identifier: getLatestRate
focal_method.invocations: getForObject format orElse findFirst map stream getResult getQuoteResponse getSymbol valueOf getRegularMarketPrice toInstant getRegularMarketTime
focal_method.modifiers: @Override public
focal_method.parameters: (String symbol)
focal_method.return: Quote
focal_method.signature: Quote getLatestRate(String symbol)