PairService { public Pair create(String code, String name, String source, String target, String exchange, String provider) { PairEntity pe = new PairEntity(code, name, new SymbolEntity(source), new SymbolEntity(target), exchange, provider); pe = pairRepo.save(pe); return pairMapper.mapToPair(pe); }  Pair getForCodeAndProvider(String code, String provider); Pair create(String code, String name, String source, String target, String exchange, String provider); void remove(String symbol, String providerCode); List<UpdatedPair> getAllWithSymbolOrNameContaining(String symbolOrName); List<Pair> getAllFromProvider(String providerCode); List<UpdatedPair> getAll();  }
@Test public void testCreate() { String code = "XAUUSD=X"; String name = "XAU/USD"; String source = "XAU"; String target = "USD"; pairService.create(code, name, source, target, null, YAHOO); Pair result = pairService.getForCodeAndProvider(code, YAHOO); assertThat(result).extracting("symbol", "name", "source.code", "target.code", "providerCode") .containsExactly(code, name, source, target, YAHOO); }