Search in sources :

Example 11 with TextResponse

use of org.folio.rest.support.TextResponse in project mod-circulation-storage by folio-org.

the class PatronActionSessionAPITest method cannotDeleteNonExistentPatronActionSessionId.

@Test
public void cannotDeleteNonExistentPatronActionSessionId() throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
    TextResponse textResponse = assertRecordClient.attemptDeleteById(UUID.randomUUID());
    assertThat(textResponse.getStatusCode(), is(404));
    assertThat(textResponse.getBody(), is("Not found"));
}
Also used : TextResponse(org.folio.rest.support.TextResponse) Test(org.junit.Test)

Example 12 with TextResponse

use of org.folio.rest.support.TextResponse in project mod-circulation-storage by folio-org.

the class LoansAnonymizationApiTest method anonymizeLoansFor.

private void anonymizeLoansFor(UUID userId) throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
    final CompletableFuture<TextResponse> postCompleted = new CompletableFuture<>();
    client.post(loanStorageUrl("/anonymize/" + userId), StorageTestSuite.TENANT_ID, ResponseHandler.text(postCompleted));
    final TextResponse postResponse = postCompleted.get(5, TimeUnit.SECONDS);
    assertThat(postResponse, isNoContent());
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) TextResponse(org.folio.rest.support.TextResponse)

Example 13 with TextResponse

use of org.folio.rest.support.TextResponse in project mod-circulation-storage by folio-org.

the class AssertingRecordClient method deleteById.

public void deleteById(UUID id) throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
    TextResponse deleteResponse = attemptDeleteById(id);
    assertThat("Failed to delete record", deleteResponse, isNoContent());
}
Also used : TextResponse(org.folio.rest.support.TextResponse)

Aggregations

TextResponse (org.folio.rest.support.TextResponse)13 Test (org.junit.Test)10 CompletableFuture (java.util.concurrent.CompletableFuture)9 JsonObject (io.vertx.core.json.JsonObject)8 UUID (java.util.UUID)6 DateTime (org.joda.time.DateTime)5 RequestRequestBuilder (org.folio.rest.support.builders.RequestRequestBuilder)4 IndividualResource (org.folio.rest.support.IndividualResource)3 JsonResponse (org.folio.rest.support.JsonResponse)3 Parameters (junitparams.Parameters)2 JsonArray (io.vertx.core.json.JsonArray)1 RequestsBatchAPI (org.folio.rest.impl.RequestsBatchAPI)1 Response (org.folio.rest.support.Response)1 ResponseHandler (org.folio.rest.support.ResponseHandler)1 LoanRequestBuilder (org.folio.rest.support.builders.LoanRequestBuilder)1 Description (org.hamcrest.Description)1 TypeSafeDiagnosingMatcher (org.hamcrest.TypeSafeDiagnosingMatcher)1 Ignore (org.junit.Ignore)1