Zonky { public void setReservationPreferences(final ReservationPreferencesImpl preferences) { controlApi.run(c -> c.setReservationPreferences(preferences)); } Zonky(final ApiProvider api, final Supplier<ZonkyApiToken> tokenSupplier); InvestmentResult invest(final Loan loan, final int amount); void cancel(final Investment investment); PurchaseResult purchase(final Participation participation); void sell(final Investment investment); void accept(final Reservation reservation); Stream<Reservation> getPendingReservations(); Stream<Investment> getInvestments(final Select select); Stream<Investment> getPendingInvestments(); Stream<Investment> getSoldInvestments(); Stream<Investment> getSellableInvestments(); Stream<Investment> getDelinquentInvestments(); Loan getLoan(final int id); Investment getInvestment(final long id); LastPublishedItem getLastPublishedLoanInfo(); LastPublishedItem getLastPublishedParticipationInfo(); ParticipationDetail getParticipationDetail(final int loanId); Stream<Loan> getAvailableLoans(final Select select); Stream<Participation> getAvailableParticipations(final Select select); ReservationPreferences getReservationPreferences(); void setReservationPreferences(final ReservationPreferencesImpl preferences); Restrictions getRestrictions(); Consents getConsents(); Statistics getStatistics();  }
@Test void reservationPreferences() { final ControlApi control = mock(ControlApi.class); final Api<ControlApi> ca = mockApi(control); final Zonky z = mockZonkyControl(ca); final ReservationPreferencesImpl r = new ReservationPreferencesImpl(); z.setReservationPreferences(r); verify(control).setReservationPreferences(eq(r)); }