diff --git a/src/test/java/api/items/TenantItemApiTests.java b/src/test/java/api/items/TenantItemApiTests.java index 52dad8346..819df4b42 100644 --- a/src/test/java/api/items/TenantItemApiTests.java +++ b/src/test/java/api/items/TenantItemApiTests.java @@ -5,7 +5,6 @@ import static api.ApiTestSuite.getBookMaterialType; import static api.ApiTestSuite.getCanCirculateLoanType; import static api.support.InstanceSamples.smallAngryPlanet; -import static java.util.concurrent.TimeUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThat; import static org.folio.inventory.resources.TenantItems.ITEMS_FIELD; import static org.folio.inventory.resources.TenantItems.TOTAL_RECORDS_FIELD; @@ -44,11 +43,11 @@ public void testTenantItemsGetFromDifferentTenants() throws MalformedURLExceptio var consortiumItemId = createConsortiumInstanceHoldingItem(); var collegeItemId = createCollegeInstanceHoldingItem(); - var consortiumItem = consortiumItemsClient.getAll().get(0); - var collegeItem = collegeItemsClient.getAll().get(0); + var consortiumItem = consortiumItemsClient.getById(consortiumItemId).getJson(); + var collegeItem = collegeItemsClient.getById(collegeItemId).getJson(); - assertThat(consortiumItem.getString(ID)).matches(consortiumItemId); - assertThat(collegeItem.getString(ID)).matches(collegeItemId); + assertThat(consortiumItem.getString(ID)).matches(consortiumItemId.toString()); + assertThat(collegeItem.getString(ID)).matches(collegeItemId.toString()); var tenantItemPariCollection = constructTenantItemPairCollection(Map.of( CONSORTIA_TENANT_ID, consortiumItem.getString(ID), @@ -63,22 +62,22 @@ public void testTenantItemsGetFromDifferentTenants() throws MalformedURLExceptio assertThat(items).contains(consortiumItem, collegeItem); } - private String createConsortiumInstanceHoldingItem() { + private UUID createConsortiumInstanceHoldingItem() { return createInstanceHoldingItem(consortiumItemsClient, consortiumHoldingsStorageClient, consortiumOkapiClient); } - private String createCollegeInstanceHoldingItem() { + private UUID createCollegeInstanceHoldingItem() { return createInstanceHoldingItem(collegeItemsClient, collegeHoldingsStorageClient, collegeOkapiClient); } - private String createInstanceHoldingItem(ResourceClient itemsStorageClient, ResourceClient holdingsStorageClient, OkapiHttpClient okapiHttpClient) { + private UUID 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 itemId = UUID.randomUUID(); var newItemRequest = JsonObject.of( - "id", itemId, + "id", itemId.toString(), "status", new JsonObject().put("name", "Available"), "holdingsRecordId", holdingId, "materialTypeId", getBookMaterialType(),