@Test void map_tokenInfoNull() { final String tokenAddress = "dafsd"; when(tokenInfoService.getTokenInfo(tokenAddress)).thenReturn(null); final TokenValueDto result = mapper.map(tokenAddress, new BigDecimal("1000000000000000000")); assertThat(result).isNull(); }
public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalance, tokenInfo.getDecimals())) .build(); }
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalance, tokenInfo.getDecimals())) .build(); } }
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalance, tokenInfo.getDecimals())) .build(); } TokenValueMapper(final TokenInfoService tokenInfoService); }
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalance, tokenInfo.getDecimals())) .build(); } TokenValueMapper(final TokenInfoService tokenInfoService); TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance); }
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalance, tokenInfo.getDecimals())) .build(); } TokenValueMapper(final TokenInfoService tokenInfoService); TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance);  }