Skip to content

Commit

Permalink
CIRC-2050 update test
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-barannyk committed Apr 1, 2024
1 parent 6adff3c commit 8ee0707
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/test/java/api/requests/AllowedServicePointsAPITests.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

import org.apache.http.HttpStatus;
import org.folio.circulation.domain.ItemStatus;
import org.folio.circulation.domain.Request;
import org.folio.circulation.domain.RequestLevel;
import org.folio.circulation.domain.RequestType;
import org.folio.circulation.support.http.client.Response;
Expand Down Expand Up @@ -753,17 +752,14 @@ void shouldReturnListOfAllowedServicePointsForRequestMove(RequestLevel requestLe
}

@Test
void circulationRuleWithMaterialTypeConditionShouldBeIgnoredIfUseStubItemIsTrue() {
void shouldUseStubItemParameterInCirculationRuleMatchingWhenPresent() {
var requesterId = usersFixture.steve().getId().toString();
var instanceId = itemsFixture.createMultipleItemsForTheSameInstance(2).get(0)
.getInstanceId().toString();
var cd1 = servicePointsFixture.cd1();
var cd2 = servicePointsFixture.cd2();
var cd4 = servicePointsFixture.cd4();
var cd5 = servicePointsFixture.cd5();
final Map<RequestType, Set<UUID>> allowedServicePointsInPolicy = new HashMap<>();
allowedServicePointsInPolicy.put(PAGE, Set.of(cd1.getId(), cd2.getId()));
allowedServicePointsInPolicy.put(HOLD, Set.of(cd4.getId(), cd5.getId()));
final UUID book = materialTypesFixture.book().getId();
final UUID patronGroup = patronGroupsFixture.regular().getId();
circulationRulesFixture.updateCirculationRules(createRules("m " + book +
Expand All @@ -785,6 +781,8 @@ void circulationRuleWithMaterialTypeConditionShouldBeIgnoredIfUseStubItemIsTrue(
assertThat(response, hasNoJsonPath(RECALL.getValue()));
allowedPageServicePoints = response.getJsonArray(PAGE.getValue());
assertServicePointsMatch(allowedPageServicePoints, List.of(cd1, cd2, cd4, cd5));

getCreateOp(requesterId, instanceId, null, "invalid", HttpStatus.SC_BAD_REQUEST);
}

private void assertServicePointsMatch(JsonArray response,
Expand Down

0 comments on commit 8ee0707

Please sign in to comment.