Skip to content

Commit

Permalink
CIRC-2051 tests refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-barannyk committed Apr 12, 2024
1 parent a0a634f commit 4f2f1ec
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/test/java/api/requests/AllowedServicePointsAPITests.java
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,15 @@ void shouldUseStubItemParameterInCirculationRuleMatchingWhenPresent() {
}

@Test
void shouldReturnEcsRequestRoutingServicePointsIfEcsRequestRoutingPresent() {
void shouldReturnErrorIfUseStubItemIsInvalid() {
Response errorResponse = getCreateOp(UUID.randomUUID().toString(),
UUID.randomUUID().toString(), null, "invalid", null,
HttpStatus.SC_BAD_REQUEST);
assertThat(errorResponse.getBody(), is("useStubItem is not a valid boolean: invalid."));
}

@Test
void shouldConsiderEcsRequestRoutingServicePointsParameterForAllowedServicePoints() {
var requesterId = usersFixture.steve().getId().toString();
var instanceId = itemsFixture.createMultipleItemsForTheSameInstance(2).get(0)
.getInstanceId().toString();
Expand Down Expand Up @@ -829,9 +837,12 @@ void shouldReturnEcsRequestRoutingServicePointsIfEcsRequestRoutingPresent() {
assertServicePointsMatch(allowedServicePoints, List.of(cd1, cd2));
assertThat(response, hasNoJsonPath(HOLD.getValue()));
assertThat(response, hasNoJsonPath(RECALL.getValue()));
}

Response errorResponse = getCreateOp(requesterId, instanceId, null, null, "invalid",
HttpStatus.SC_BAD_REQUEST);
@Test
void shouldReturnErrorIfEcsRequestRoutingIsInvalid() {
Response errorResponse = getCreateOp(UUID.randomUUID().toString(),
UUID.randomUUID().toString(), null, null, "invalid", HttpStatus.SC_BAD_REQUEST);
assertThat(errorResponse.getBody(), is("ecsRequestRouting is not a valid boolean: invalid."));
}

Expand Down

0 comments on commit 4f2f1ec

Please sign in to comment.