From 56398ca4ee863aaaedb7e6627d19ac4a2ca1406b Mon Sep 17 00:00:00 2001 From: saba_zedginidze Date: Mon, 26 Aug 2024 18:26:25 +0400 Subject: [PATCH] [MODINVSTOR-1243] Update tests --- src/test/java/api/items/TenantItemApiTests.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/java/api/items/TenantItemApiTests.java b/src/test/java/api/items/TenantItemApiTests.java index 9c933c985..4f79139c3 100644 --- a/src/test/java/api/items/TenantItemApiTests.java +++ b/src/test/java/api/items/TenantItemApiTests.java @@ -47,8 +47,8 @@ public void testTenantItemsGetFromDifferentTenants() throws MalformedURLExceptio var consortiumItem = getItems(consortiumOkapiClient, 1).get(0); var collegeItem = getItems(collegeOkapiClient, 1).get(0); - assertThat(consortiumItem.getString(ID)).matches(consortiumItemId.toString()); - assertThat(collegeItem.getString(ID)).matches(collegeItemId.toString()); + assertThat(consortiumItem.getString(ID)).matches(consortiumItemId); + assertThat(collegeItem.getString(ID)).matches(collegeItemId); var tenantItemPariCollection = constructTenantItemPairCollection(Map.of( CONSORTIA_TENANT_ID, consortiumItem.getString(ID), @@ -63,26 +63,28 @@ public void testTenantItemsGetFromDifferentTenants() throws MalformedURLExceptio assertThat(items).contains(consortiumItem, collegeItem); } - private UUID createConsortiumInstanceHoldingItem() { + private String createConsortiumInstanceHoldingItem() { return createInstanceHoldingItem(consortiumItemsClient, consortiumHoldingsStorageClient, consortiumOkapiClient); } - private UUID createCollegeInstanceHoldingItem() { + private String createCollegeInstanceHoldingItem() { return createInstanceHoldingItem(collegeItemsClient, collegeHoldingsStorageClient, collegeOkapiClient); } - private UUID createInstanceHoldingItem(ResourceClient itemStorageClient, ResourceClient holdingsStorageClient, OkapiHttpClient okapiHttpClient) { + private String createInstanceHoldingItem(ResourceClient itemsStorageClient, ResourceClient holdingsStorageClient, OkapiHttpClient okapiHttpClient) { var instanceId = UUID.randomUUID(); InstanceApiClient.createInstance(okapiHttpClient, smallAngryPlanet(instanceId)); var holdingId = holdingsStorageClient.create(new HoldingRequestBuilder() .forInstance(instanceId)).getId(); + var itemId = UUID.randomUUID().toString(); var newItemRequest = JsonObject.of( - "id", UUID.randomUUID().toString(), + "id", itemId, "status", new JsonObject().put("name", "Available"), "holdingsRecordId", holdingId, "materialTypeId", getBookMaterialType(), "permanentLoanTypeId", getCanCirculateLoanType()); - return itemsStorageClient.create(newItemRequest).getId(); + itemsStorageClient.create(newItemRequest); + return itemId; } private List getItems(OkapiHttpClient okapiHttpClient, int expected)