@Test
void nothingRecommendedDueToRatingOverinvested() {

    final ParsedStrategy p = new ParsedStrategy(DefaultPortfolio.PROGRESSIVE, Collections.emptySet());
    final InvestmentStrategy s = new NaturalLanguageInvestmentStrategy(p);
    final PortfolioOverview portfolio = mock(PortfolioOverview.class);
    when(portfolio.getShareOnInvestment(any())).thenReturn(Ratio.ZERO);
    when(portfolio.getInvested()).thenReturn(p.getMaximumInvestmentSize()
        .subtract(1));
    final LoanImpl l = mockLoan(1000);
    final Rating r = l.getRating();
    when(portfolio.getShareOnInvestment(eq(r))).thenReturn(Ratio.fromPercentage("100"));
    final Stream<RecommendedLoan> result = s.recommend(Collections.singletonList(new LoanDescriptor(l)),
            portfolio, mockSessionInfo());
    assertThat(result).isEmpty();
}