use of org.folio.rest.support.IndividualResource in project mod-circulation-storage by folio-org.
the class RequestsApiTest method createCancellationReason.
private IndividualResource createCancellationReason(String name, String description) throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
final JsonObject body = new JsonObject();
body.put("name", name);
body.put("description", description);
CompletableFuture<JsonResponse> createCompleted = new CompletableFuture<>();
client.post(cancelReasonURL(), body, TENANT_ID, ResponseHandler.json(createCompleted));
JsonResponse postResponse = createCompleted.get(5, TimeUnit.SECONDS);
assertThat(String.format("Failed to create cancellation reason: %s", postResponse.getBody()), postResponse.getStatusCode(), is(HTTP_CREATED));
return new IndividualResource(postResponse);
}
use of org.folio.rest.support.IndividualResource in project mod-circulation-storage by folio-org.
the class LoansAnonymizationApiTest method shouldNotAnonymizeLoansHistoryForOtherUser.
@Test
public void shouldNotAnonymizeLoansHistoryForOtherUser() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
final UUID firstUserId = UUID.randomUUID();
final UUID secondUserId = UUID.randomUUID();
final IndividualResource loanForOtherUser = loansClient.create(new LoanRequestBuilder().closed().withUserId(firstUserId));
anonymizeLoansFor(secondUserId);
hasLoanHistoryForUser(firstUserId, loanForOtherUser.getId());
}
use of org.folio.rest.support.IndividualResource in project mod-circulation-storage by folio-org.
the class AssertingRecordClient method getById.
public IndividualResource getById(UUID id) throws InterruptedException, ExecutionException, TimeoutException, MalformedURLException {
JsonResponse response = attemptGetById(id);
assertThat("Failed to get record", response, isOk());
return new IndividualResource(response);
}
use of org.folio.rest.support.IndividualResource in project mod-circulation-storage by folio-org.
the class AssertingRecordClient method create.
public IndividualResource create(JsonObject representation) throws InterruptedException, ExecutionException, TimeoutException, MalformedURLException {
JsonResponse response = attemptCreate(representation);
assertThat("Failed to create record", response, isCreated());
return new IndividualResource(response);
}
Aggregations