Skip to content

Commit

Permalink
Add test for the new route to get service points for item
Browse files Browse the repository at this point in the history
  • Loading branch information
vijay-eis committed Oct 15, 2024
1 parent 75aea2f commit d5142ad
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/test/java/org/folio/edge/patron/MainVerticleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1151,9 +1151,28 @@ public void testAllowedServicePointsSuccess(TestContext context) throws Exceptio
JsonObject actual = new JsonObject(resp.body().asString());
assertEquals(expected, actual);
}
@Test
public void testAllowedServicePointsForItemError(TestContext context) throws Exception {
logger.info("=== Test validation error during allowed service points request ===");

final Response resp = RestAssured
.with()
.get(String.format("/patron/account/%s/item/%s/allowed-service-points?apikey=%s",
patronId, instanceId_notFound, apiKey))
.then()
.statusCode(422)
.header(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON)
.extract()
.response();

JsonObject expected = new JsonObject(readMockFile(
"/allowed_sp_error_edge_patron.json"));
JsonObject actual = new JsonObject(resp.body().asString());
assertEquals(expected, actual);
}

@Test
public void testAllowedServicePointsError(TestContext context) throws Exception {
public void testAllowedServicePointsForInstanceError(TestContext context) throws Exception {
logger.info("=== Test validation error during allowed service points request ===");

final Response resp = RestAssured
Expand Down

0 comments on commit d5142ad

Please sign in to comment.