From d5142ad27f741153ddaf1d8c76eda0b00c0f2491 Mon Sep 17 00:00:00 2001 From: vijay-eis Date: Mon, 14 Oct 2024 15:51:18 -0400 Subject: [PATCH] Add test for the new route to get service points for item --- .../folio/edge/patron/MainVerticleTest.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/folio/edge/patron/MainVerticleTest.java b/src/test/java/org/folio/edge/patron/MainVerticleTest.java index aa94411..6a7c388 100644 --- a/src/test/java/org/folio/edge/patron/MainVerticleTest.java +++ b/src/test/java/org/folio/edge/patron/MainVerticleTest.java @@ -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