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());
}
Aggregations