use of api.support.MultipleJsonRecords in project mod-circulation by folio-org.
the class LoanAPITests method canGetLoanPolicyPropertiesForMultipleLoans.
@Test
void canGetLoanPolicyPropertiesForMultipleLoans() {
configClient.create(ConfigurationExample.utcTimezoneConfiguration());
IndividualResource item1 = itemsFixture.basedUponSmallAngryPlanet();
final ItemResource item2 = itemsFixture.basedUponNod();
final IndividualResource user1 = usersFixture.jessica();
final IndividualResource user2 = usersFixture.steve();
checkOutFixture.checkOutByBarcode(item1, user1, ZonedDateTime.of(2018, 4, 21, 11, 21, 43, 0, UTC));
checkOutFixture.checkOutByBarcode(item2, user2, ZonedDateTime.of(2018, 4, 21, 11, 21, 43, 0, UTC));
final IndividualResource loanPolicy = loanPoliciesFixture.canCirculateRolling();
MultipleJsonRecords loans = loansFixture.getAllLoans();
loans.forEach(loanJson -> {
loanHasLoanPolicyProperties(loanJson, loanPolicy);
loanHasOverdueFinePolicyProperties(loanJson, overdueFinePoliciesFixture.facultyStandard());
loanHasLostItemPolicyProperties(loanJson, lostItemFeePoliciesFixture.facultyStandard());
});
}
use of api.support.MultipleJsonRecords in project mod-circulation by folio-org.
the class LoanAPITests method canGetMultipleFeesFinesForMultipleLoans.
@Test
void canGetMultipleFeesFinesForMultipleLoans() {
configClient.create(ConfigurationExample.utcTimezoneConfiguration());
IndividualResource item1 = itemsFixture.basedUponSmallAngryPlanet();
final ItemResource item2 = itemsFixture.basedUponNod();
final IndividualResource user1 = usersFixture.jessica();
final IndividualResource user2 = usersFixture.steve();
IndividualResource loan1 = checkOutFixture.checkOutByBarcode(item1, user1, ZonedDateTime.of(2018, 4, 21, 11, 21, 43, 0, UTC));
IndividualResource loan2 = checkOutFixture.checkOutByBarcode(item2, user2, ZonedDateTime.of(2018, 4, 21, 11, 21, 43, 0, UTC));
accountsClient.create(new AccountBuilder().feeFineStatusOpen().withLoan(loan1).withRemainingFeeFine(100));
accountsClient.create(new AccountBuilder().feeFineStatusOpen().withLoan(loan1).withRemainingFeeFine(100));
accountsClient.create(new AccountBuilder().feeFineStatusOpen().withLoan(loan2).withRemainingFeeFine(99));
accountsClient.create(new AccountBuilder().feeFineStatusOpen().withLoan(loan2).withRemainingFeeFine(1000));
MultipleJsonRecords loans = loansFixture.getAllLoans();
JsonObject fetchedLoan1 = loans.getById(loan1.getId());
JsonObject fetchedLoan2 = loans.getById(loan2.getId());
assertLoanHasFeeFinesProperties(fetchedLoan1, 200);
assertLoanHasFeeFinesProperties(fetchedLoan2, 1099);
}
use of api.support.MultipleJsonRecords in project mod-circulation by folio-org.
the class CheckInByBarcodeTests method verifyCheckInOperationRecorded.
private void verifyCheckInOperationRecorded(UUID itemId, UUID servicePoint) {
final CqlQuery query = CqlQuery.queryFromTemplate("itemId=%s", itemId);
final MultipleJsonRecords recordedOperations = checkInOperationClient.getMany(query);
assertThat(recordedOperations.totalRecords(), is(1));
recordedOperations.forEach(checkInOperation -> {
assertThat(checkInOperation.getString("occurredDateTime"), withinSecondsBeforeNow(2));
assertThat(checkInOperation.getString("itemId"), is(itemId.toString()));
assertThat(checkInOperation.getString("servicePointId"), is(servicePoint.toString()));
assertThat(checkInOperation.getString("performedByUserId"), is(getUserId()));
});
}
use of api.support.MultipleJsonRecords in project mod-circulation by folio-org.
the class RequestsAPIRetrievalTests method canSearchForRequestsByRequesterLastName.
@Test
void canSearchForRequestsByRequesterLastName() {
UUID firstRequester = usersFixture.steve().getId();
UUID secondRequester = usersFixture.jessica().getId();
final UUID pickupServicePointId = servicePointsFixture.cd1().getId();
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponSmallAngryPlanet(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(firstRequester));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponNod(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(firstRequester));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponInterestingTimes(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(secondRequester));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponTemeraire(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(firstRequester));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponNod(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(firstRequester));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponUprooted(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(secondRequester));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponTemeraire(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).withRequesterId(secondRequester));
final MultipleJsonRecords requests = requestsFixture.getRequests(queryFromTemplate("requester.lastName=%s", "Pontefract"), noLimit(), noOffset());
assertThat(requests.size(), is(3));
assertThat(requests.totalRecords(), is(3));
requests.forEach(this::requestHasExpectedProperties);
}
use of api.support.MultipleJsonRecords in project mod-circulation by folio-org.
the class RequestsAPIRetrievalTests method canSearchForRequestsByProxyLastName.
@Test
void canSearchForRequestsByProxyLastName() {
final IndividualResource sponsor = usersFixture.jessica();
final IndividualResource firstProxy = usersFixture.charlotte();
final IndividualResource secondProxy = usersFixture.james();
final UUID pickupServicePointId = servicePointsFixture.cd1().getId();
proxyRelationshipsFixture.currentProxyFor(sponsor, firstProxy);
proxyRelationshipsFixture.currentProxyFor(sponsor, secondProxy);
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponSmallAngryPlanet(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).by(sponsor).proxiedBy(firstProxy));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponNod(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).by(sponsor).proxiedBy(secondProxy));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponNod(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).by(sponsor).proxiedBy(secondProxy));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponUprooted(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).by(sponsor).proxiedBy(firstProxy));
requestsFixture.place(new RequestBuilder().forItem(itemsFixture.basedUponTemeraire(ItemBuilder::checkOut)).withPickupServicePointId(pickupServicePointId).by(sponsor).proxiedBy(secondProxy));
final MultipleJsonRecords requests = requestsFixture.getRequests(queryFromTemplate("proxy.lastName=%s", "Rodwell"), noLimit(), noOffset());
assertThat(requests.size(), is(3));
assertThat(requests.totalRecords(), is(3));
requests.forEach(this::requestHasExpectedProperties);
}
Aggregations