test_class.declarator: symbolRepo
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private SymbolRepository symbolRepo;
test_class.type: SymbolRepository
test_class.var_name: symbolRepo
test_class.declarator: symbolService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private SymbolService symbolService;
test_class.type: SymbolService
test_class.var_name: symbolService
test_class.file: trading-common/src/test/java/fr/ymanvieu/trading/common/symbol/SymbolServiceTest.java
test_class.identifier: SymbolServiceTest
test_case.body: @Test
  	public void testAddSymbol_NotExistWithNotExistingCurrency() {
  		// given
  		String code = "TOTO";
  		String name = "toto";
  		String currencyCode = "XXX";
  
  		// when
  		assertThatThrownBy(() -> symbolService.addSymbol(code, name, null, currencyCode))
  				.hasRootCauseInstanceOf(EntityNotFoundException.class)
  				.hasMessageContaining("Unable to find fr.ymanvieu.trading.common.symbol.entity.SymbolEntity with id XXX");
  	}
test_case.class_method_signature: SymbolServiceTest.testAddSymbol_NotExistWithNotExistingCurrency()
test_case.full_signature: @Test public void testAddSymbol_NotExistWithNotExistingCurrency()
test_case.identifier: testAddSymbol_NotExistWithNotExistingCurrency
test_case.invocations: hasMessageContaining hasRootCauseInstanceOf assertThatThrownBy addSymbol
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAddSymbol_NotExistWithNotExistingCurrency()
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: favoriteSymbolRepository
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private FavoriteSymbolRepository favoriteSymbolRepository;
focal_class.type: FavoriteSymbolRepository
focal_class.var_name: favoriteSymbolRepository
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/symbol/SymbolService.java
focal_class.identifier: SymbolService
focal_class.class_method_signature: SymbolService.addSymbol(String code, String name, String countryFlag, String currencyCode)
focal_class.full_signature: public Symbol addSymbol(String code, String name, String countryFlag, String currencyCode)
focal_class.identifier: addSymbol
focal_class.modifiers: public
focal_class.parameters: (String code, String name, String countryFlag, String currencyCode)
focal_class.return: Symbol
focal_class.signature: Symbol addSymbol(String code, String name, String countryFlag, String currencyCode)
focal_class.class_method_signature: SymbolService.getForCode(String code)
focal_class.full_signature: public Optional<Symbol> getForCode(String code)
focal_class.identifier: getForCode
focal_class.modifiers: public
focal_class.parameters: (String code)
focal_class.return: Optional<Symbol>
focal_class.signature: Optional<Symbol> getForCode(String code)
focal_class.class_method_signature: SymbolService.getForCodeWithNoCurrency(String code)
focal_class.full_signature: public Optional<Symbol> getForCodeWithNoCurrency(String code)
focal_class.identifier: getForCodeWithNoCurrency
focal_class.modifiers: public
focal_class.parameters: (String code)
focal_class.return: Optional<Symbol>
focal_class.signature: Optional<Symbol> getForCodeWithNoCurrency(String code)
focal_class.class_method_signature: SymbolService.addFavoriteSymbol(String fromSymbolCode, String toSymbolCode, String username)
focal_class.full_signature: public void addFavoriteSymbol(String fromSymbolCode, String toSymbolCode, String username)
focal_class.identifier: addFavoriteSymbol
focal_class.modifiers: public
focal_class.parameters: (String fromSymbolCode, String toSymbolCode, String username)
focal_class.return: void
focal_class.signature: void addFavoriteSymbol(String fromSymbolCode, String toSymbolCode, String username)
focal_class.class_method_signature: SymbolService.deleteFavoriteSymbol(String fromSymbolCode, String toSymbolCode, String username)
focal_class.full_signature: public void deleteFavoriteSymbol(String fromSymbolCode, String toSymbolCode, String username)
focal_class.identifier: deleteFavoriteSymbol
focal_class.modifiers: public
focal_class.parameters: (String fromSymbolCode, String toSymbolCode, String username)
focal_class.return: void
focal_class.signature: void deleteFavoriteSymbol(String fromSymbolCode, String toSymbolCode, String username)
focal_method.body: public Symbol addSymbol(String code, String name, String countryFlag, String currencyCode) {
  		requireNonNull(code, "code is null");
  		requireNonNull(name, "name is null");
  		
  		if(symbolRepo.existsById(code)) {
  			throw SymbolException.alreadyExists(code);
  		}
  
  		SymbolEntity se = new SymbolEntity(code);
  		se.setName(name);
  		se.setCountryFlag(countryFlag);
  		
  		if(currencyCode != null) {
  			se.setCurrency(new SymbolEntity(currencyCode));
  		}
  
  		return symbolMapper.mapToSymbol(symbolRepo.save(se));
  	}
focal_method.class_method_signature: SymbolService.addSymbol(String code, String name, String countryFlag, String currencyCode)
focal_method.full_signature: public Symbol addSymbol(String code, String name, String countryFlag, String currencyCode)
focal_method.identifier: addSymbol
focal_method.invocations: requireNonNull requireNonNull existsById alreadyExists setName setCountryFlag setCurrency mapToSymbol save
focal_method.modifiers: public
focal_method.parameters: (String code, String name, String countryFlag, String currencyCode)
focal_method.return: Symbol
focal_method.signature: Symbol addSymbol(String code, String name, String countryFlag, String currencyCode)