Search in sources :

Example 1 with Response

use of org.folio.circulation.support.http.client.Response in project mod-circulation by folio-org.

the class AgeToLostFixture method ageToLostAndAttemptChargeFees.

public Response ageToLostAndAttemptChargeFees() {
    ageToLost();
    moveTimeForwardForChargeFee();
    final Response response = timedTaskClient.attemptRun(scheduledAgeToLostFeeChargingUrl(), "scheduled-age-to-lost-fee-charging");
    setDefaultClock();
    return response;
}
Also used : Response(org.folio.circulation.support.http.client.Response)

Example 2 with Response

use of org.folio.circulation.support.http.client.Response in project mod-circulation by folio-org.

the class EventSubscribersFixture method publishLoanRelatedFeeFineClosedEvent.

public void publishLoanRelatedFeeFineClosedEvent(UUID loanId) {
    final Response response = attemptPublishLoanRelatedFeeFineClosedEvent(loanId, UUID.randomUUID());
    assertThat(response.getStatusCode(), is(204));
}
Also used : Response(org.folio.circulation.support.http.client.Response)

Example 3 with Response

use of org.folio.circulation.support.http.client.Response in project mod-circulation by folio-org.

the class CirculationRulesFixture method applyRulesForNoticePolicy.

public Policy applyRulesForNoticePolicy(ItemType itemType, LoanType loanType, PatronGroup patronGroup, ItemLocation location) {
    final Response response = applyRulesForPolicy(itemType, loanType, patronGroup, location, "/notice-policy", "apply-rules-to-get-notice-policy");
    String requestPolicyId = response.getJson().getString("noticePolicyId");
    assertThat(requestPolicyId, is(not(nullValue())));
    return new Policy(requestPolicyId);
}
Also used : Response(org.folio.circulation.support.http.client.Response) RestAssuredResponseConversion.toResponse(api.support.RestAssuredResponseConversion.toResponse) Policy(org.folio.circulation.rules.Policy)

Example 4 with Response

use of org.folio.circulation.support.http.client.Response in project mod-circulation by folio-org.

the class CirculationRulesFixture method applyRulesForLoanPolicy.

public Policy applyRulesForLoanPolicy(ItemType itemType, LoanType loanType, PatronGroup patronGroup, ItemLocation location) {
    final Response response = applyRulesForPolicy(itemType, loanType, patronGroup, location, "/loan-policy", "apply-rules-to-get-loan-policy");
    String loanPolicyId = response.getJson().getString("loanPolicyId");
    assertThat(loanPolicyId, is(not(nullValue())));
    return new Policy(loanPolicyId);
}
Also used : Response(org.folio.circulation.support.http.client.Response) RestAssuredResponseConversion.toResponse(api.support.RestAssuredResponseConversion.toResponse) Policy(org.folio.circulation.rules.Policy)

Example 5 with Response

use of org.folio.circulation.support.http.client.Response in project mod-circulation by folio-org.

the class CirculationRulesFixture method getCirculationRules.

public String getCirculationRules() {
    Response getResponse = restAssuredClient.get(circulationRulesUrl(), "get-circulation-rules");
    JsonObject rulesJson = new JsonObject(getResponse.getBody());
    return rulesJson.getString("rulesAsText");
}
Also used : Response(org.folio.circulation.support.http.client.Response) RestAssuredResponseConversion.toResponse(api.support.RestAssuredResponseConversion.toResponse) JsonObject(io.vertx.core.json.JsonObject)

Aggregations

Response (org.folio.circulation.support.http.client.Response)408 Test (org.junit.jupiter.api.Test)362 IndividualResource (api.support.http.IndividualResource)264 UUID (java.util.UUID)174 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)158 RequestBuilder (api.support.builders.RequestBuilder)126 JsonObject (io.vertx.core.json.JsonObject)121 ZonedDateTime (java.time.ZonedDateTime)115 ItemResource (api.support.http.ItemResource)91 MoveRequestBuilder (api.support.builders.MoveRequestBuilder)50 ClockUtil.getZonedDateTime (org.folio.circulation.support.utils.ClockUtil.getZonedDateTime)39 CheckOutByBarcodeRequestBuilder (api.support.builders.CheckOutByBarcodeRequestBuilder)36 LoanPolicyBuilder (api.support.builders.LoanPolicyBuilder)33 lombok.val (lombok.val)29 CheckInByBarcodeRequestBuilder (api.support.builders.CheckInByBarcodeRequestBuilder)26 LoanBuilder (api.support.builders.LoanBuilder)24 OkapiHeaders (api.support.http.OkapiHeaders)20 ClaimItemReturnedRequestBuilder (api.support.builders.ClaimItemReturnedRequestBuilder)19 CheckOutBlockOverrides (api.support.builders.CheckOutBlockOverrides)18 EnumSource (org.junit.jupiter.params.provider.EnumSource)18