test_class.declarator: SEARCH_RESULT = readFile("/provider/lookup/yahoo/search_ubi.json")
test_class.modifier: private static final
test_class.original_string: private static final String SEARCH_RESULT = readFile("/provider/lookup/yahoo/search_ubi.json");
test_class.type: String
test_class.var_name: SEARCH_RESULT
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: yahooLookup = new YahooLookup()
test_class.modifier: private
test_class.original_string: private YahooLookup yahooLookup = new YahooLookup();
test_class.type: YahooLookup
test_class.var_name: yahooLookup
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/lookup/yahoo/YahooLookupTest.java
test_class.identifier: YahooLookupTest
test_case.body: @Test
  	@Parameters
  	public void testParseSource(String code, String expectedResult) {
  		assertThat(YahooLookup.parseSource(code)).isEqualTo(expectedResult);
  	}
test_case.class_method_signature: YahooLookupTest.testParseSource(String code, String expectedResult)
test_case.full_signature: @Test @Parameters public void testParseSource(String code, String expectedResult)
test_case.identifier: testParseSource
test_case.invocations: isEqualTo assertThat parseSource
test_case.modifiers: @Test @Parameters public
test_case.parameters: (String code, String expectedResult)
test_case.return: void
test_case.signature: void testParseSource(String code, String expectedResult)
focal_class.declarator: EQUITY_PATTERN = Pattern.compile("([\\w_-]+)[\\.[\\w]*]*")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern EQUITY_PATTERN = Pattern.compile("([\\w_-]+)[\\.[\\w]*]*");
focal_class.type: Pattern
focal_class.var_name: EQUITY_PATTERN
focal_class.declarator: FOREX_PATTERN = Pattern.compile("(\\w{3})(\\w{3})?=X")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern FOREX_PATTERN = Pattern.compile("(\\w{3})(\\w{3})?=X");
focal_class.type: Pattern
focal_class.var_name: FOREX_PATTERN
focal_class.declarator: FUTURE_PATTERN = Pattern.compile("(\\w+=F)")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern FUTURE_PATTERN = Pattern.compile("(\\w+=F)");
focal_class.type: Pattern
focal_class.var_name: FUTURE_PATTERN
focal_class.declarator: CRYPTOCURRENCY_PATTERN = Pattern.compile("([\\w]{3,4})-([\\w]{3,4})")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern CRYPTOCURRENCY_PATTERN = Pattern.compile("([\\w]{3,4})-([\\w]{3,4})");
focal_class.type: Pattern
focal_class.var_name: CRYPTOCURRENCY_PATTERN
focal_class.declarator: url
focal_class.modifier: @Value("${provider.yahoo.url.lookup}")
  	private
focal_class.original_string: @Value("${provider.yahoo.url.lookup}")
  	private String url;
focal_class.type: String
focal_class.var_name: url
focal_class.declarator: urlLatest
focal_class.modifier: @Value("${provider.yahoo.url.latest}")
  	private
focal_class.original_string: @Value("${provider.yahoo.url.latest}")
  	private String urlLatest;
focal_class.type: String
focal_class.var_name: urlLatest
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.file: trading-common/src/main/java/fr/ymanvieu/trading/common/provider/lookup/yahoo/YahooLookup.java
focal_class.identifier: YahooLookup
focal_class.interfaces: implements LookupProvider
focal_class.class_method_signature: YahooLookup.search(String symbolOrName)
focal_class.full_signature: @Override public List<LookupInfo> search(String symbolOrName)
focal_class.identifier: search
focal_class.modifiers: @Override public
focal_class.parameters: (String symbolOrName)
focal_class.return: List<LookupInfo>
focal_class.signature: List<LookupInfo> search(String symbolOrName)
focal_class.class_method_signature: YahooLookup.getDetails(String code)
focal_class.full_signature: @Override public LookupDetails getDetails(String code)
focal_class.identifier: getDetails
focal_class.modifiers: @Override public
focal_class.parameters: (String code)
focal_class.return: LookupDetails
focal_class.signature: LookupDetails getDetails(String code)
focal_class.class_method_signature: YahooLookup.parseSource(String code)
focal_class.full_signature: @VisibleForTesting protected static String parseSource(String code)
focal_class.identifier: parseSource
focal_class.modifiers: @VisibleForTesting protected static
focal_class.parameters: (String code)
focal_class.return: String
focal_class.signature: String parseSource(String code)
focal_class.class_method_signature: YahooLookup.parseTarget(String code)
focal_class.full_signature: @VisibleForTesting protected static String parseTarget(String code)
focal_class.identifier: parseTarget
focal_class.modifiers: @VisibleForTesting protected static
focal_class.parameters: (String code)
focal_class.return: String
focal_class.signature: String parseTarget(String code)
focal_class.class_method_signature: YahooLookup.getProviderCode()
focal_class.full_signature: @Override public String getProviderCode()
focal_class.identifier: getProviderCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getProviderCode()
focal_method.body: @VisibleForTesting
  	protected static String parseSource(String code) {
  		Matcher forexMatcher = FOREX_PATTERN.matcher(code);
  		
  		if (forexMatcher.matches()) {
  			String source = forexMatcher.group(1);
  			String target = forexMatcher.group(2);
  			return (target != null) ? source : CurrencyUtils.USD;
  		}
  		
  		Matcher cryptoMatcher = CRYPTOCURRENCY_PATTERN.matcher(code);
  		
  		if (cryptoMatcher.matches()) {
  			return cryptoMatcher.group(1);
  		}
  		
  		Matcher stockMatcher = EQUITY_PATTERN.matcher(code);
  
  		if (stockMatcher.matches()) {
  			return stockMatcher.group(1);
  		}
  		
  		Matcher futureMatcher = FUTURE_PATTERN.matcher(code);
  
  		if (futureMatcher.matches()) {
  			return futureMatcher.group(1);
  		}
  
  		return null;
  	}
focal_method.class_method_signature: YahooLookup.parseSource(String code)
focal_method.full_signature: @VisibleForTesting protected static String parseSource(String code)
focal_method.identifier: parseSource
focal_method.invocations: matcher matches group group matcher matches group matcher matches group matcher matches group
focal_method.modifiers: @VisibleForTesting protected static
focal_method.parameters: (String code)
focal_method.return: String
focal_method.signature: String parseSource(String code)