Search in sources :

Example 1 with LoanBuilder

use of com.github.robozonky.api.remote.entities.sanitized.LoanBuilder in project robozonky by RoboZonky.

the class AbstractZonkyLeveragingTest method mockLoanDescriptor.

private static LoanDescriptor mockLoanDescriptor(final int loanId, final boolean withCaptcha) {
    final LoanBuilder b = Loan.custom().setId(loanId).setRemainingInvestment(Integer.MAX_VALUE).setDatePublished(OffsetDateTime.now()).setMyInvestment(mockMyInvestment());
    if (withCaptcha) {
        // enable CAPTCHA for the rating
        System.setProperty(Settings.Key.CAPTCHA_DELAY_D.getName(), "120");
        b.setRating(Rating.D);
    } else {
        // disable CAPTCHA for the rating
        System.setProperty(Settings.Key.CAPTCHA_DELAY_AAAAA.getName(), "0");
        b.setRating(Rating.AAAAA);
    }
    return new LoanDescriptor(b.build());
}
Also used : LoanBuilder(com.github.robozonky.api.remote.entities.sanitized.LoanBuilder) LoanDescriptor(com.github.robozonky.api.strategies.LoanDescriptor)

Aggregations

LoanBuilder (com.github.robozonky.api.remote.entities.sanitized.LoanBuilder)1 LoanDescriptor (com.github.robozonky.api.strategies.LoanDescriptor)1