@Test
void readsMarketplace() {

    final Loan l = new MockLoanBuilder().build();
    int loanId = l.getId();
    final Participation p = mock(ParticipationImpl.class);
    when(p.getId()).thenReturn(1l);
    when(p.getLoanId()).thenReturn(loanId);
    when(p.getLoanHealthInfo()).thenReturn(LoanHealth.HEALTHY);
    final Zonky zonky = harmlessZonky();
    when(zonky.getLoan(eq(loanId))).thenReturn(l);
    when(zonky.getAvailableParticipations(any())).thenReturn(Stream.of(p));
    final PowerTenant tenant = mockTenant(zonky);
    final AbstractMarketplaceAccessor<ParticipationDescriptor> d = new SecondaryMarketplaceAccessor(tenant,
            UnaryOperator.identity());
    final Collection<ParticipationDescriptor> pd = d.getMarketplace();
    assertThat(pd).hasSize(1)
        .element(0)
        .extracting(ParticipationDescriptor::item)
        .isSameAs(p);
    assertThat(pd)
        .element(0)
        .extracting(ParticipationDescriptor::related)
        .isSameAs(l);
}