@Test
void purchaseFailure() {

    final ControlApi control = mock(ControlApi.class);
    final Api<ControlApi> ca = mockApi(control);
    doThrow(new ClientErrorException(Response.Status.FORBIDDEN)).when(control)
        .purchase(anyLong(), any());
    final Zonky z = mockZonkyControl(ca);
    final Participation p = mock(ParticipationImpl.class);
    when(p.getRemainingPrincipal()).thenReturn(Money.from(10));
    when(p.getId()).thenReturn(1L);
    assertThat(z.purchase(p)
        .getFailureType()).contains(PurchaseFailureType.UNKNOWN);
}