@Test
void purchasingSomeAccepted() {

    final Loan loan = new MockLoanBuilder()
        .set(LoanImpl::setAmount, Money.from(100_000))
        .set(LoanImpl::setRating, Rating.D)
        .set(LoanImpl::setRemainingInvestment, Money.from(1_000))
        .set(LoanImpl::setReservedAmount, Money.from(0))
        .set(LoanImpl::setMyInvestment, mockMyInvestment())
        .set(LoanImpl::setDatePublished, OffsetDateTime.now())
        .build();
    final int loanId = loan.getId();
    final Rating rating = loan.getRating();
    final Zonky zonky = harmlessZonky();
    when(zonky.getLoan(eq(loanId))).thenReturn(loan);
    final Participation mock = mock(ParticipationImpl.class);
    when(mock.getId()).thenReturn(1L);
    when(mock.getLoanId()).thenReturn(loanId);
    when(mock.getRemainingPrincipal()).thenReturn(Money.from(250));
    when(mock.getRating()).thenReturn(rating);
    final ParticipationDescriptor pd = new ParticipationDescriptor(mock, () -> loan);
    final PowerTenant tenant = mockTenant(zonky);
    when(tenant.getPurchaseStrategy()).thenReturn(Optional.of(ALL_ACCEPTING_PURCHASE_STRATEGY));
    final PurchasingOperationDescriptor d = mockPurchasingOperationDescriptor(pd);
    final StrategyExecutor<ParticipationDescriptor, PurchaseStrategy, Participation> exec = new StrategyExecutor<>(
            tenant, d);
    assertThat(exec.get()).isNotEmpty();
    verify(zonky, never()).purchase(eq(mock)); // do not purchase as we're in dry run
    final List<Event> e = getEventsRequested();
    assertThat(e).hasSize(4);
    assertSoftly(softly -> {
        softly.assertThat(e)
            .first()
            .isInstanceOf(PurchasingStartedEvent.class);
        softly.assertThat(e.get(1))
            .isInstanceOf(PurchaseRecommendedEvent.class);
        softly.assertThat(e.get(2))
            .isInstanceOf(InvestmentPurchasedEvent.class);
        softly.assertThat(e)
            .last()
            .isInstanceOf(PurchasingCompletedEvent.class);
    });
    // doing a dry run; the same participation is now ignored
    assertThat(exec.get()).isEmpty();
}