@@ -0,0 +1,2302 @@
+/*%0A * Copyright 2018 The RoboZonky Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.github.robozonky.app.portfolio;%0A%0Aimport java.util.Collections;%0A%0Aimport com.github.robozonky.api.notifications.LoanRepaidEvent;%0Aimport com.github.robozonky.api.remote.entities.Investment;%0Aimport com.github.robozonky.api.remote.entities.Loan;%0Aimport com.github.robozonky.api.remote.enums.PaymentStatus;%0Aimport com.github.robozonky.app.AbstractZonkyLeveragingTest;%0Aimport com.github.robozonky.app.authentication.Authenticated;%0Aimport com.github.robozonky.common.remote.Zonky;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static org.assertj.core.api.Assertions.*;%0Aimport static org.mockito.Mockito.*;%0A%0Aclass RepaymentsTest extends AbstractZonkyLeveragingTest %7B%0A%0A    @Test%0A    void registerNewRepayments() %7B%0A        final Loan l = spy(new Loan(1, 1000));%0A        when(l.getRemainingInvestment()).thenReturn(0.0);%0A        final Investment i = spy(new Investment(l, 200));%0A        // first, portfolio contains one active investment; no repaid%0A        final Portfolio p = new Portfolio(Collections.singletonList(i));%0A        final Zonky z = harmlessZonky(10_000);%0A        when(z.getLoan(eq(l.getId()))).thenReturn(l);%0A        final Authenticated a = mockAuthentication(z);%0A        final Repayments r = new Repayments(true);%0A        r.accept(p, a);%0A        assertThat(getNewEvents()).isEmpty();%0A        // now, portfolio has the same investment marked as paid; event will be triggered%0A        when(i.getPaymentStatus()).thenReturn(PaymentStatus.PAID);%0A        r.accept(p, a);%0A        assertThat(getNewEvents())%0A                .first()%0A                .isInstanceOf(LoanRepaidEvent.class);%0A        // make sure the loan was retrieved from Zonky%0A        verify(z).getLoan(eq(l.getId()));%0A    %7D%0A%7D%0A

Increase mutation coverage in robozonky-app to make AppVeyor happy