@Test
void recommendationIsMade() {

    final DefaultValues v = new DefaultValues(DefaultPortfolio.PROGRESSIVE);
    final ParsedStrategy p = new ParsedStrategy(v, Collections.emptyList(), Collections.emptyMap(),
            Collections.emptyMap(),
            new FilterSupplier(v, null, Collections.emptySet()));
    final PurchaseStrategy s = new NaturalLanguagePurchaseStrategy(p);
    final PortfolioOverview portfolio = mock(PortfolioOverview.class);
    when(portfolio.getInvested()).thenReturn(p.getMaximumInvestmentSize()
        .subtract(1));
    when(portfolio.getShareOnInvestment(any())).thenReturn(Ratio.ZERO);
    final Participation participation = mockParticipation();
    doReturn(Money.from(100_000)).when(participation)
        .getRemainingPrincipal(); // not recommended for balance
    doReturn(Rating.A).when(participation)
        .getRating();
    final Participation p2 = mockParticipation();
    final int amount = 199; // check amounts under Zonky investment minimum
    doReturn(Money.from(amount)).when(p2)
        .getRemainingPrincipal();
    doReturn(Rating.A).when(p2)
        .getRating();
    final ParticipationDescriptor pd = mockDescriptor(p2);
    final List<RecommendedParticipation> result = s
        .recommend(asList(mockDescriptor(participation), pd), portfolio, mockSessionInfo())
        .collect(Collectors.toList());
    assertThat(result).hasSize(1);
    final RecommendedParticipation r = result.get(0);
    assertSoftly(softly -> {
        softly.assertThat(r.descriptor())
            .isEqualTo(pd);
        softly.assertThat(r.amount())
            .isEqualTo(pd.item()
                .getRemainingPrincipal());
    });
}