use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageParameterizedTest method cannotUpdateHridSettingsWithBadData.
@Test
public void cannotUpdateHridSettingsWithBadData() throws InterruptedException, ExecutionException, TimeoutException {
log.info("Starting cannotUpdateHridSettingsWithBadData()");
final CompletableFuture<Response> putCompleted = new CompletableFuture<>();
final HridSettings newHridSettings = new HridSettings().withInstances(new HridSetting().withPrefix(instancePrefix).withStartNumber(instanceStartNumber)).withHoldings(new HridSetting().withPrefix(holdingPrefix).withStartNumber(holdingStartNumber)).withItems(new HridSetting().withPrefix(itemPrefix).withStartNumber(itemStartNumber));
client.put(InterfaceUrls.hridSettingsStorageUrl(""), newHridSettings, TENANT_ID, json(putCompleted));
final Response putResponse = putCompleted.get(5, SECONDS);
verifyValidationError(putResponse, keyPart + '.' + testField, expectedValue);
log.info("Finished cannotUpdateHridSettingsWithBadData()");
}
use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageTest method canGetNextInstanceHridAfterSettingStartNumberWithoutLeadingZeroes.
@Test
public void canGetNextInstanceHridAfterSettingStartNumberWithoutLeadingZeroes(TestContext testContext) {
log.info("Starting canGetNextInstanceHridAfterSettingStartNumberWithoutLeadingZeroes()");
final HridSettings newHridSettings = new HridSettings().withInstances(new HridSetting().withPrefix("in").withStartNumber(250L)).withHoldings(new HridSetting().withPrefix("ho").withStartNumber(1L)).withItems(new HridSetting().withPrefix("it").withStartNumber(1L)).withCommonRetainLeadingZeroes(false);
hridManager.updateHridSettings(newHridSettings).onComplete(testContext.asyncAssertSuccess(hridSettingsResult -> getNextInstanceHrid().compose(hrid -> validateHrid(hrid, "in250", testContext)).onComplete(testContext.asyncAssertSuccess(v -> log.info("Finished canGetNextInstanceHridAfterSettingStartNumberWithoutLeadingZeroes()")))));
}
use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageTest method canGetNextInstanceHridAfterSettingStartNumber.
@Test
public void canGetNextInstanceHridAfterSettingStartNumber(TestContext testContext) {
log.info("Starting canGetNextInstanceHridAfterSettingStartNumber()");
final HridSettings newHridSettings = new HridSettings().withInstances(new HridSetting().withPrefix("in").withStartNumber(250L)).withHoldings(new HridSetting().withPrefix("ho").withStartNumber(1L)).withItems(new HridSetting().withPrefix("it").withStartNumber(1L));
hridManager.updateHridSettings(newHridSettings).onComplete(testContext.asyncAssertSuccess(hridSettingsResult -> getNextInstanceHrid().compose(hrid -> validateHrid(hrid, "in00000000250", testContext)).onComplete(testContext.asyncAssertSuccess(v -> log.info("Finished canGetNextInstanceHridAfterSettingStartNumber()")))));
}
use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageTest method canGetNextHridWhenStartNumberIsLongWithoutLeadingZeroes.
@Test
public void canGetNextHridWhenStartNumberIsLongWithoutLeadingZeroes(TestContext testContext) {
log.info("Starting canGetNextHridWhenStartNumberIsLongWithoutLeadingZeroes()");
final HridSettings newHridSettings = new HridSettings().withInstances(new HridSetting().withStartNumber(9_999_999_997L)).withHoldings(new HridSetting().withStartNumber(9_999_999_998L)).withItems(new HridSetting().withStartNumber(9_999_999_999L)).withCommonRetainLeadingZeroes(false);
hridManager.updateHridSettings(newHridSettings).compose(v -> getNextInstanceHrid()).compose(hrid -> validateHrid(hrid, "9999999997", testContext)).compose(v -> getNextHoldingsHrid()).compose(hrid -> validateHrid(hrid, "9999999998", testContext)).compose(v -> getNextItemHrid()).compose(hrid -> validateHrid(hrid, "9999999999", testContext)).onComplete(testContext.asyncAssertSuccess(v1 -> log.info("Finished canGetNextHridWhenStartNumberIsLongWithoutLeadingZeroes()")));
}
use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageTest method canGetNextHoldingHridAfterSettingStartNumberWithoutLeadingZeroes.
@Test
public void canGetNextHoldingHridAfterSettingStartNumberWithoutLeadingZeroes(TestContext testContext) {
log.info("Starting canGetNextHoldingHridAfterSettingStartNumberWithoutLeadingZeroes()");
final HridSettings newHridSettings = new HridSettings().withInstances(new HridSetting().withPrefix("in").withStartNumber(1L)).withHoldings(new HridSetting().withPrefix("ho").withStartNumber(7890L)).withItems(new HridSetting().withPrefix("it").withStartNumber(1L)).withCommonRetainLeadingZeroes(false);
hridManager.updateHridSettings(newHridSettings).onComplete(testContext.asyncAssertSuccess(hridSettings -> getNextHoldingsHrid().compose(hrid -> validateHrid(hrid, "ho7890", testContext)).onComplete(testContext.asyncAssertSuccess(v -> log.info("Finished canGetNextHoldingHridAfterSettingStartNumberWithoutLeadingZeroes()")))));
}
Aggregations