use of api.support.builders.HoldingRequestBuilder in project mod-inventory by folio-org.
the class HoldingsApiExamples method canUpdateAnExistingMARCHoldingsIfNoChanges.
@Test
public void canUpdateAnExistingMARCHoldingsIfNoChanges() throws Exception {
UUID instanceId = instancesClient.create(InstanceRequestExamples.smallAngryPlanet()).getId();
JsonObject newHoldings = holdingsStorageClient.create(new HoldingRequestBuilder().forInstance(instanceId).withMarcSource()).getJson();
JsonObject holdingsForUpdate = newHoldings.copy();
Response putResponse = updateHoldings(holdingsForUpdate);
assertThat(putResponse.getStatusCode(), is(NO_CONTENT.code()));
Response getResponse = holdingsStorageClient.getById(getId(newHoldings));
assertThat(getResponse.getStatusCode(), is(OK.code()));
JsonObject updatedHoldings = getResponse.getJson();
newHoldings.stream().forEach(e -> assertEquals(updatedHoldings.getMap().get(e.getKey()), e.getValue()));
}
Aggregations