test_class.declarator: PERCENT_OFFSET = offset(0.000000000001d)
test_class.modifier: private static final
test_class.original_string: private static final Offset<Double> PERCENT_OFFSET = offset(0.000000000001d);
test_class.type: Offset<Double>
test_class.var_name: PERCENT_OFFSET
test_class.declarator: portofolioService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PortofolioService portofolioService;
test_class.type: PortofolioService
test_class.var_name: portofolioService
test_class.declarator: portofolioRepo
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PortofolioRepository portofolioRepo;
test_class.type: PortofolioRepository
test_class.var_name: portofolioRepo
test_class.file: trading-common/src/test/java/fr/ymanvieu/trading/common/portofolio/PortofolioServiceTest.java
test_class.identifier: PortofolioServiceTest
test_case.body: @Sql("/sql/insert_user_symbol.sql")
  	@Test
  	public void testCreatePortofolio() {
  		String login = "user";
  		String baseCurrency = EUR;
  		int amount = 1000;
  
  		Portofolio p = portofolioService.createPortofolio(login, baseCurrency, amount);
  
  		assertThat(p.getBaseCurrency().getSymbol().getCode()).isEqualTo(baseCurrency);
  		assertThat(p.getBaseCurrency().getQuantity()).isEqualTo(amount);
  	}
test_case.class_method_signature: PortofolioServiceTest.testCreatePortofolio()
test_case.full_signature: @Sql("/sql/insert_user_symbol.sql") @Test public void testCreatePortofolio()
test_case.identifier: testCreatePortofolio
test_case.invocations: createPortofolio isEqualTo assertThat getCode getSymbol getBaseCurrency isEqualTo assertThat getQuantity getBaseCurrency
test_case.modifiers: @Sql("/sql/insert_user_symbol.sql") @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreatePortofolio()
focal_class.declarator: userRepo
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private UserRepository userRepo;
focal_class.type: UserRepository
focal_class.var_name: userRepo
focal_class.declarator: portofolioRepo
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private PortofolioRepository portofolioRepo;
focal_class.type: PortofolioRepository
focal_class.var_name: portofolioRepo
focal_class.declarator: symbolRepo
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private SymbolRepository symbolRepo;
focal_class.type: SymbolRepository
focal_class.var_name: symbolRepo
focal_class.declarator: rateService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private RateService rateService;
focal_class.type: RateService
focal_class.var_name: rateService
focal_class.declarator: symbolMapper
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private SymbolMapper symbolMapper;
focal_class.type: SymbolMapper
focal_class.var_name: symbolMapper
focal_class.file: trading-common/src/main/java/fr/ymanvieu/trading/common/portofolio/PortofolioService.java
focal_class.identifier: PortofolioService
focal_class.class_method_signature: PortofolioService.createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.full_signature: public Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.identifier: createPortofolio
focal_class.modifiers: public
focal_class.parameters: (String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.return: Portofolio
focal_class.signature: Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.class_method_signature: PortofolioService.getBaseCurrency(String login)
focal_class.full_signature: public AssetInfo getBaseCurrency(String login)
focal_class.identifier: getBaseCurrency
focal_class.modifiers: public
focal_class.parameters: (String login)
focal_class.return: AssetInfo
focal_class.signature: AssetInfo getBaseCurrency(String login)
focal_class.class_method_signature: PortofolioService.getPortofolio(String login)
focal_class.full_signature: public Portofolio getPortofolio(String login)
focal_class.identifier: getPortofolio
focal_class.modifiers: public
focal_class.parameters: (String login)
focal_class.return: Portofolio
focal_class.signature: Portofolio getPortofolio(String login)
focal_class.class_method_signature: PortofolioService.getAsset(AssetEntity ae)
focal_class.full_signature: protected AssetInfo getAsset(AssetEntity ae)
focal_class.identifier: getAsset
focal_class.modifiers: protected
focal_class.parameters: (AssetEntity ae)
focal_class.return: AssetInfo
focal_class.signature: AssetInfo getAsset(AssetEntity ae)
focal_class.class_method_signature: PortofolioService.getOrderInfo(String login, String symbolCode, double quantity)
focal_class.full_signature: public OrderInfo getOrderInfo(String login, String symbolCode, double quantity)
focal_class.identifier: getOrderInfo
focal_class.modifiers: public
focal_class.parameters: (String login, String symbolCode, double quantity)
focal_class.return: OrderInfo
focal_class.signature: OrderInfo getOrderInfo(String login, String symbolCode, double quantity)
focal_class.class_method_signature: PortofolioService.getAvailableSymbols(String login)
focal_class.full_signature: public List<Symbol> getAvailableSymbols(String login)
focal_class.identifier: getAvailableSymbols
focal_class.modifiers: public
focal_class.parameters: (String login)
focal_class.return: List<Symbol>
focal_class.signature: List<Symbol> getAvailableSymbols(String login)
focal_class.class_method_signature: PortofolioService.buy(String login, String code, double quantity)
focal_class.full_signature: public Order buy(String login, String code, double quantity)
focal_class.identifier: buy
focal_class.modifiers: public
focal_class.parameters: (String login, String code, double quantity)
focal_class.return: Order
focal_class.signature: Order buy(String login, String code, double quantity)
focal_class.class_method_signature: PortofolioService.sell(String login, String code, double quantity)
focal_class.full_signature: public Order sell(String login, String code, double quantity)
focal_class.identifier: sell
focal_class.modifiers: public
focal_class.parameters: (String login, String code, double quantity)
focal_class.return: Order
focal_class.signature: Order sell(String login, String code, double quantity)
focal_method.body: public Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount) {
  		UserEntity ue = userRepo.findByUsername(login);
  		SymbolEntity se = symbolRepo.findById(baseCurrencyCode).get();
  
  		// FIXME add checks
  
  		PortofolioEntity pe = new PortofolioEntity(ue, se, BigDecimal.valueOf(baseCurrencyAmount));
  
  		portofolioRepo.save(pe);
  
  		return getPortofolio(login);
  	}
focal_method.class_method_signature: PortofolioService.createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_method.full_signature: public Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_method.identifier: createPortofolio
focal_method.invocations: findByUsername get findById valueOf save getPortofolio
focal_method.modifiers: public
focal_method.parameters: (String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_method.return: Portofolio
focal_method.signature: Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)