@Test
public void statisticsReturnsMostFundedProject() {
TokenAmountDto tokenAmount = new TokenAmountDto(fnd.getAddress(), EthUtil.toWei(BigDecimal.TEN, fnd.getDecimals()));
TokenAmountDto tokenAmount2 = new TokenAmountDto(zrx.getAddress(), EthUtil.toWei(BigDecimal.ONE, zrx.getDecimals()));
List<Object[]> requests = Arrays.asList(
createObject("FundRequest", fnd.getAddress(), tokenAmount.getTotalAmount()),
createObject("Dock", zrx.getAddress(), tokenAmount2.getTotalAmount())
);
when(fundRepository.getAmountPerTokenPerProjectWhereRequestHasStatusFunded()).thenReturn(requests);
when(fiatService.getUsdPrice(TokenValueDto.builder()
.tokenSymbol(fnd.getSymbol())
.tokenAddress(fnd.getAddress())
.totalAmount(EthUtil.fromWei(tokenAmount.getTotalAmount(), fnd.getDecimals()))
.build())).thenReturn(10.0);
when(fiatService.getUsdPrice(TokenValueDto.builder()
.tokenSymbol(zrx.getSymbol())
.tokenAddress(zrx.getAddress())
.totalAmount(EthUtil.fromWei(tokenAmount2.getTotalAmount(), zrx.getDecimals()))
.build())).thenReturn(20.0);
StatisticsDto result = statisticsService.getStatistics();
assertThat(result.getMostFundedProject()).isEqualTo("Dock");
}