@Test
void recommendationIsMade() {

    final ParsedStrategy p = new ParsedStrategy(DefaultPortfolio.PROGRESSIVE, Collections.emptySet());
    final InvestmentStrategy s = new NaturalLanguageInvestmentStrategy(p);
    final PortfolioOverview portfolio = mock(PortfolioOverview.class);
    when(portfolio.getInvested()).thenReturn(p.getMaximumInvestmentSize()
        .subtract(1));
    when(portfolio.getShareOnInvestment(any())).thenReturn(Ratio.ZERO);
    final LoanImpl l = mockLoan(100_000);
    final LoanImpl l2 = mockLoan(100);
    final LoanDescriptor ld = new LoanDescriptor(l);
    final List<RecommendedLoan> result = s
        .recommend(Arrays.asList(new LoanDescriptor(l2), ld), portfolio, mockSessionInfo())
        .collect(Collectors.toList());
    assertThat(result).hasSize(1);
    final RecommendedLoan r = result.get(0);
    assertSoftly(softly -> {
        softly.assertThat(r.descriptor())
            .isEqualTo(ld);
        softly.assertThat(r.amount())
            .isEqualTo(Money.from(20_000)); // maximum allowed investment
    });
}