Skip to content

Commit

Permalink
CIRC-1980: Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksat-Galymzhan committed Jul 5, 2024
1 parent 3d25182 commit a0a7a2f
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/test/java/api/loans/CheckInByBarcodeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import org.folio.circulation.domain.Request;
import org.folio.circulation.domain.RequestStatus;
import org.folio.circulation.domain.User;
import org.folio.circulation.domain.policy.ExpirationDateManagement;
import org.folio.circulation.domain.policy.Period;
import org.folio.circulation.support.http.client.Response;
import org.folio.circulation.support.utils.ClockUtil;
Expand Down Expand Up @@ -1666,8 +1667,6 @@ void linkItemToHoldTLRWithHoldShelfWhenCheckedInItemThenFulfilledWithSuccess(){

@Test
void checkInItemWhenServiceHasChangedToNoPickupLocation(){
int intervalDuration = 0;
String intervalId = null;
reconfigureTlrFeature(TlrFeatureStatus.NOT_CONFIGURED);
configurationsFixture.enableTlrFeature();
UUID instanceId = instancesFixture.basedUponDunkirk().getId();
Expand All @@ -1676,10 +1675,22 @@ void checkInItemWhenServiceHasChangedToNoPickupLocation(){
IndividualResource holdRequestBeforeFulfilled = requestsClient.create(buildHoldTLRWithHoldShelffulfillmentPreference(instanceId));

String servicePointCode = servicePointsFixture.cd1().getJson().getString("code");
ServicePointBuilder changedServicePoint = ServicePointBuilder.from(servicePointsFixture.cd1())
.withPickupLocation(Boolean.FALSE)
.withHoldShelfExpriyPeriod(intervalDuration, intervalId)
.withName("custom service point");
String servicePointName = "custom service point";
int shelvingLagTime = 0;
String discoveryDisplayName = servicePointsFixture.cd1().getJson().getString("discoveryDisplayName");
String description = servicePointsFixture.cd1().getJson().getString("description");

ServicePointBuilder changedServicePoint = new ServicePointBuilder(
servicePointsFixture.cd1().getId(),
servicePointName,
servicePointCode,
discoveryDisplayName,
description,
shelvingLagTime,
Boolean.FALSE,
null,
ExpirationDateManagement.KEEP_THE_CURRENT_DUE_DATE.name()
);

// Update existing service point
servicePointsFixture.update(servicePointCode, changedServicePoint);
Expand All @@ -1706,7 +1717,6 @@ void checkInItemWhenServiceHasChangedToNoPickupLocation(){

JsonObject servicePointRepresentation = representation.getJsonObject("pickupServicePoint");
Assertions.assertFalse(Boolean.parseBoolean(servicePointRepresentation.getString("pickupLocation")));
assertThat(servicePointRepresentation.getString("shelvingLagTime"), nullValue());
}

@Test
Expand Down

0 comments on commit a0a7a2f

Please sign in to comment.