use of api.support.builders.AccountBuilder in project mod-circulation by folio-org.
the class LoanAPITests method canGetMultipleFeesFinesForSingleLoan.
@Test
void canGetMultipleFeesFinesForSingleLoan() {
UUID id = UUID.randomUUID();
UUID itemId = itemsFixture.basedUponSmallAngryPlanet().getId();
IndividualResource user = usersFixture.charlotte();
UUID userId = user.getId();
ZonedDateTime loanDate = ZonedDateTime.of(2017, 2, 27, 10, 23, 43, 0, UTC);
ZonedDateTime dueDate = ZonedDateTime.of(2017, 3, 29, 10, 23, 43, 0, UTC);
IndividualResource response = loansFixture.createLoan(new LoanBuilder().withId(id).open().withUserId(userId).withItemId(itemId).withLoanDate(loanDate).withDueDate(dueDate));
accountsClient.create(new AccountBuilder().feeFineStatusOpen().withLoan(response).withRemainingFeeFine(150));
JsonObject loan = loansFixture.getLoanById(id).getJson();
assertLoanHasFeeFinesProperties(loan, 150d);
accountsClient.create(new AccountBuilder().feeFineStatusOpen().withLoan(response).withRemainingFeeFine(150));
loan = loansFixture.getLoanById(id).getJson();
assertLoanHasFeeFinesProperties(loan, 300d);
}
Aggregations