Skip to content

Commit

Permalink
Demonstrate incorrect item status when cancelling awaiting pickup pag…
Browse files Browse the repository at this point in the history
…e request CIRC-429
  • Loading branch information
marcjohnson-kint committed Aug 30, 2019
1 parent d2a82ac commit c5771be
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/test/java/api/requests/scenarios/CancelRequestTests.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package api.requests.scenarios;

import static api.support.matchers.ItemStatusCodeMatcher.hasItemStatus;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.junit.MatcherAssert.assertThat;
Expand All @@ -14,9 +15,11 @@
import org.folio.circulation.domain.MultipleRecords;
import org.folio.circulation.support.http.client.IndividualResource;
import org.joda.time.DateTime;
import org.junit.Ignore;
import org.junit.Test;

import api.support.APITests;
import api.support.builders.RequestBuilder;
import io.vertx.core.json.JsonObject;

public class CancelRequestTests extends APITests {
Expand Down Expand Up @@ -196,4 +199,35 @@ public void canCancelRequestAtTheEndOfTheQueue()
assertThat("Should be in same order as before cancellation", requestIds, contains(
requestByJessica.getId(), requestBySteve.getId(), requestByCharlotte.getId()));
}

/**
* In order for items to appear on the hold shelf clearance report they need
* to retain the request fulfilment related status after being cancelled
*/
@Ignore("As the fix is being cherry picked this cannot be fixed within the same commit")
@Test
public void cancellingAPartiallyFulfilledPageRequestErroneouslyResetsItemStatus()
throws InterruptedException,
MalformedURLException,
TimeoutException,
ExecutionException {

IndividualResource smallAngryPlanet = itemsFixture.basedUponSmallAngryPlanet();
IndividualResource jessica = usersFixture.jessica();

final IndividualResource requestByJessica = requestsFixture.place(
new RequestBuilder()
.page()
.forItem(smallAngryPlanet)
.by(jessica)
.fulfilToHoldShelf(servicePointsFixture.cd1()));

loansFixture.checkInByBarcode(smallAngryPlanet);

requestsFixture.cancelRequest(requestByJessica);

final IndividualResource itemAfterCancellation = itemsClient.get(smallAngryPlanet);

assertThat(itemAfterCancellation, hasItemStatus("Paged"));
}
}

0 comments on commit c5771be

Please sign in to comment.