Search in sources :

Example 6 with ControlApi

use of com.github.robozonky.api.remote.ControlApi in project robozonky by RoboZonky.

the class ZonkyTest method cancel.

@Test
void cancel() {
    final ControlApi control = mock(ControlApi.class);
    final Api<ControlApi> ca = mockApi(control);
    final PaginatedApi<RawLoan, LoanApi> la = mockApi();
    final PaginatedApi<BlockedAmount, WalletApi> wa = mockApi();
    final PaginatedApi<RawInvestment, PortfolioApi> pa = mockApi();
    final PaginatedApi<Participation, ParticipationApi> sa = mockApi();
    final PaginatedApi<RawDevelopment, CollectionsApi> caa = mockApi();
    final Zonky z = new Zonky(ca, la, sa, pa, wa, caa);
    final Investment i = mock(Investment.class);
    when(i.getId()).thenReturn(1);
    z.cancel(i);
    verify(control).cancel(eq(i.getId()));
}
Also used : Participation(com.github.robozonky.api.remote.entities.Participation) ParticipationApi(com.github.robozonky.api.remote.ParticipationApi) WalletApi(com.github.robozonky.api.remote.WalletApi) LoanApi(com.github.robozonky.api.remote.LoanApi) PortfolioApi(com.github.robozonky.api.remote.PortfolioApi) BlockedAmount(com.github.robozonky.api.remote.entities.BlockedAmount) RawLoan(com.github.robozonky.api.remote.entities.RawLoan) ControlApi(com.github.robozonky.api.remote.ControlApi) RawDevelopment(com.github.robozonky.api.remote.entities.RawDevelopment) CollectionsApi(com.github.robozonky.api.remote.CollectionsApi) RawInvestment(com.github.robozonky.api.remote.entities.RawInvestment) Investment(com.github.robozonky.api.remote.entities.sanitized.Investment) RawInvestment(com.github.robozonky.api.remote.entities.RawInvestment) Test(org.junit.jupiter.api.Test)

Aggregations

ControlApi (com.github.robozonky.api.remote.ControlApi)6 BlockedAmount (com.github.robozonky.api.remote.entities.BlockedAmount)6 CollectionsApi (com.github.robozonky.api.remote.CollectionsApi)5 LoanApi (com.github.robozonky.api.remote.LoanApi)5 ParticipationApi (com.github.robozonky.api.remote.ParticipationApi)5 PortfolioApi (com.github.robozonky.api.remote.PortfolioApi)5 WalletApi (com.github.robozonky.api.remote.WalletApi)5 Participation (com.github.robozonky.api.remote.entities.Participation)5 RawDevelopment (com.github.robozonky.api.remote.entities.RawDevelopment)5 RawInvestment (com.github.robozonky.api.remote.entities.RawInvestment)5 RawLoan (com.github.robozonky.api.remote.entities.RawLoan)5 Test (org.junit.jupiter.api.Test)5 Investment (com.github.robozonky.api.remote.entities.sanitized.Investment)4 ConfirmationProvider (com.github.robozonky.api.confirmations.ConfirmationProvider)1 Event (com.github.robozonky.api.notifications.Event)1 ExecutionCompletedEvent (com.github.robozonky.api.notifications.ExecutionCompletedEvent)1 ExecutionStartedEvent (com.github.robozonky.api.notifications.ExecutionStartedEvent)1 InvestmentDelegatedEvent (com.github.robozonky.api.notifications.InvestmentDelegatedEvent)1 InvestmentMadeEvent (com.github.robozonky.api.notifications.InvestmentMadeEvent)1 InvestmentRejectedEvent (com.github.robozonky.api.notifications.InvestmentRejectedEvent)1