Search in sources :

Example 1 with HoldingsMessage

use of org.folio.service.holdings.message.HoldingsMessage in project mod-kb-ebsco-java by folio-org.

the class TransactionLoadHoldingsImplTest method shouldSendSaveHoldingsEventForEachLoadedPage.

@Test
public void shouldSendSaveHoldingsEventForEachLoadedPage(TestContext context) throws IOException, URISyntaxException {
    mockEmptyTransactionList();
    mockGet(new EqualToPattern(getStatusEndpoint()), RMAPI_RESPONSE_TRANSACTION_STATUS_COMPLETED);
    mockGet(new RegexPattern(getHoldingsEndpoint()), RMAPI_RESPONSE_HOLDINGS);
    List<HoldingsMessage> messages = new ArrayList<>();
    Async async = context.async(EXPECTED_LOADED_PAGES);
    interceptor = interceptAndStop(HOLDINGS_SERVICE_ADDRESS, SAVE_HOLDINGS_ACTION, message -> {
        messages.add(((JsonObject) message.body()).getJsonObject("holdings").mapTo(HoldingsMessage.class));
        async.countDown();
    });
    vertx.eventBus().addOutboundInterceptor(interceptor);
    LoadServiceFacade proxy = LoadServiceFacade.createProxy(vertx, LOAD_FACADE_ADDRESS);
    LoadHoldingsMessage message = new LoadHoldingsMessage(this.configuration, STUB_CREDENTIALS_ID, STUB_TENANT, 5001, 2, TRANSACTION_ID, null);
    proxy.loadHoldings(message);
    async.await(TIMEOUT);
    assertEquals(2, messages.size());
    assertEquals(STUB_HOLDINGS_TITLE, messages.get(0).getHoldingList().get(0).getPublicationTitle());
}
Also used : TestContext(io.vertx.ext.unit.TestContext) STUB_TOKEN_HEADER(org.folio.util.KbCredentialsTestUtil.STUB_TOKEN_HEADER) KbCredentialsTestUtil.saveKbCredentials(org.folio.util.KbCredentialsTestUtil.saveKbCredentials) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) HoldingsMessage(org.folio.service.holdings.message.HoldingsMessage) URISyntaxException(java.net.URISyntaxException) KBTestUtil.interceptAndContinue(org.folio.util.KBTestUtil.interceptAndContinue) Autowired(org.springframework.beans.factory.annotation.Autowired) LoadStatusNameEnum(org.folio.rest.jaxrs.model.LoadStatusNameEnum) LoadHoldingsMessage(org.folio.service.holdings.message.LoadHoldingsMessage) MockitoAnnotations(org.mockito.MockitoAnnotations) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) After(org.junit.After) Spy(org.mockito.Spy) HoldingsStatusUtil.saveStatusNotStarted(org.folio.util.HoldingsStatusUtil.saveStatusNotStarted) TransactionId(org.folio.holdingsiq.model.TransactionId) JsonObject(io.vertx.core.json.JsonObject) KBTestUtil.clearDataFromTable(org.folio.util.KBTestUtil.clearDataFromTable) KBTestUtil.interceptAndStop(org.folio.util.KBTestUtil.interceptAndStop) WireMock.post(com.github.tomakehurst.wiremock.client.WireMock.post) SC_INTERNAL_SERVER_ERROR(org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR) HoldingsTransactionIdsList(org.folio.holdingsiq.model.HoldingsTransactionIdsList) RMAPI_DELTAS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_DELTAS_URL) LoadServiceFacade(org.folio.service.holdings.LoadServiceFacade) SNAPSHOT_FAILED_ACTION(org.folio.service.holdings.HoldingConstants.SNAPSHOT_FAILED_ACTION) AfterClass(org.junit.AfterClass) ResponseDefinitionBuilder(com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder) SNAPSHOT_CREATED_ACTION(org.folio.service.holdings.HoldingConstants.SNAPSHOT_CREATED_ACTION) STUB_TENANT(org.folio.test.util.TestUtil.STUB_TENANT) UUID(java.util.UUID) HoldingsService(org.folio.service.holdings.HoldingsService) RMAPI_TRANSACTIONS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_TRANSACTIONS_URL) Collectors(java.util.stream.Collectors) HOLDINGS_SERVICE_ADDRESS(org.folio.service.holdings.HoldingConstants.HOLDINGS_SERVICE_ADDRESS) RequestPatternBuilder(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder) KB_CREDENTIALS_TABLE_NAME(org.folio.repository.kbcredentials.KbCredentialsTableConstants.KB_CREDENTIALS_TABLE_NAME) RMAPI_DELTA_BY_ID_URL(org.folio.rest.impl.RmApiConstants.RMAPI_DELTA_BY_ID_URL) List(java.util.List) StringValuePattern(com.github.tomakehurst.wiremock.matching.StringValuePattern) OffsetDateTime(java.time.OffsetDateTime) Assert.assertFalse(org.junit.Assert.assertFalse) Configuration(org.folio.holdingsiq.model.Configuration) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) SC_NO_CONTENT(org.apache.http.HttpStatus.SC_NO_CONTENT) Async(io.vertx.ext.unit.Async) Json(io.vertx.core.json.Json) HoldingsTestUtil(org.folio.util.HoldingsTestUtil) BeforeClass(org.junit.BeforeClass) HOLDINGS_LOAD_BY_ID_URL(org.folio.rest.impl.integrationsuite.DefaultLoadHoldingsImplTest.HOLDINGS_LOAD_BY_ID_URL) RegexPattern(com.github.tomakehurst.wiremock.matching.RegexPattern) RunWith(org.junit.runner.RunWith) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) TestUtil.mockResponseList(org.folio.test.util.TestUtil.mockResponseList) ArrayList(java.util.ArrayList) DbHoldingInfo(org.folio.repository.holdings.DbHoldingInfo) COMPLETED(org.folio.rest.jaxrs.model.LoadStatusNameEnum.COMPLETED) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) HoldingsRetryStatusTestUtil.insertRetryStatus(org.folio.util.HoldingsRetryStatusTestUtil.insertRetryStatus) Before(org.junit.Before) TestUtil.mockGetWithBody(org.folio.test.util.TestUtil.mockGetWithBody) InjectMocks(org.mockito.InjectMocks) DeliveryContext(io.vertx.core.eventbus.DeliveryContext) UrlPathPattern(com.github.tomakehurst.wiremock.matching.UrlPathPattern) TestUtil.mockGet(org.folio.test.util.TestUtil.mockGet) RMAPI_TRANSACTION_STATUS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_TRANSACTION_STATUS_URL) Assert.assertTrue(org.junit.Assert.assertTrue) Matchers(org.hamcrest.Matchers) IOException(java.io.IOException) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) WireMock.verify(com.github.tomakehurst.wiremock.client.WireMock.verify) EqualToPattern(com.github.tomakehurst.wiremock.matching.EqualToPattern) HoldingsDownloadTransaction(org.folio.holdingsiq.model.HoldingsDownloadTransaction) STUB_CREDENTIALS_NAME(org.folio.util.KbCredentialsTestUtil.STUB_CREDENTIALS_NAME) Consumer(java.util.function.Consumer) LOAD_FACADE_ADDRESS(org.folio.service.holdings.HoldingConstants.LOAD_FACADE_ADDRESS) HoldingsStatusRepositoryImpl(org.folio.repository.holdings.status.HoldingsStatusRepositoryImpl) ChronoUnit(java.time.temporal.ChronoUnit) TransactionIdTestUtil(org.folio.util.TransactionIdTestUtil) RetryStatusRepository(org.folio.repository.holdings.status.retry.RetryStatusRepository) RMAPI_DELTA_STATUS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_DELTA_STATUS_URL) WireMock.stubFor(com.github.tomakehurst.wiremock.client.WireMock.stubFor) TestUtil.readFile(org.folio.test.util.TestUtil.readFile) RequestMethod(com.github.tomakehurst.wiremock.http.RequestMethod) RMAPI_TRANSACTION_BY_ID_URL(org.folio.rest.impl.RmApiConstants.RMAPI_TRANSACTION_BY_ID_URL) RMAPI_POST_TRANSACTIONS_HOLDINGS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_POST_TRANSACTIONS_HOLDINGS_URL) Handler(io.vertx.core.Handler) SAVE_HOLDINGS_ACTION(org.folio.service.holdings.HoldingConstants.SAVE_HOLDINGS_ACTION) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) LoadServiceFacade(org.folio.service.holdings.LoadServiceFacade) RegexPattern(com.github.tomakehurst.wiremock.matching.RegexPattern) Async(io.vertx.ext.unit.Async) EqualToPattern(com.github.tomakehurst.wiremock.matching.EqualToPattern) ArrayList(java.util.ArrayList) LoadHoldingsMessage(org.folio.service.holdings.message.LoadHoldingsMessage) HoldingsMessage(org.folio.service.holdings.message.HoldingsMessage) LoadHoldingsMessage(org.folio.service.holdings.message.LoadHoldingsMessage) Test(org.junit.Test)

Example 2 with HoldingsMessage

use of org.folio.service.holdings.message.HoldingsMessage in project mod-kb-ebsco-java by folio-org.

the class DefaultLoadHoldingsImplTest method shouldSendSaveHoldingsEventForEachLoadedPage.

@Test
public void shouldSendSaveHoldingsEventForEachLoadedPage(TestContext context) throws IOException, URISyntaxException {
    mockGet(new EqualToPattern(RMAPI_HOLDINGS_STATUS_URL), RMAPI_RESPONSE_HOLDINGS_STATUS_COMPLETED);
    mockGet(new RegexPattern(RMAPI_POST_HOLDINGS_URL), RMAPI_RESPONSE_HOLDINGS);
    List<HoldingsMessage> messages = new ArrayList<>();
    Async async = context.async(EXPECTED_LOADED_PAGES);
    interceptor = interceptAndStop(HOLDINGS_SERVICE_ADDRESS, SAVE_HOLDINGS_ACTION, message -> {
        messages.add(((JsonObject) message.body()).getJsonObject("holdings").mapTo(HoldingsMessage.class));
        async.countDown();
    });
    vertx.eventBus().addOutboundInterceptor(interceptor);
    LoadServiceFacade proxy = LoadServiceFacade.createProxy(vertx, LOAD_FACADE_ADDRESS);
    proxy.loadHoldings(new LoadHoldingsMessage(stubConfiguration, STUB_CREDENTIALS_ID, STUB_TENANT, 5001, 2, null, null));
    async.await(TIMEOUT);
    assertEquals(2, messages.size());
    assertEquals(STUB_HOLDINGS_TITLE, messages.get(0).getHoldingList().get(0).getPublicationTitle());
}
Also used : HoldingsLoadingStatusFactory.getStatusLoadingHoldings(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getStatusLoadingHoldings) RMAPI_POST_HOLDINGS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_POST_HOLDINGS_URL) TestContext(io.vertx.ext.unit.TestContext) STUB_TOKEN_HEADER(org.folio.util.KbCredentialsTestUtil.STUB_TOKEN_HEADER) KbCredentialsTestUtil.saveKbCredentials(org.folio.util.KbCredentialsTestUtil.saveKbCredentials) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) HoldingsMessage(org.folio.service.holdings.message.HoldingsMessage) URISyntaxException(java.net.URISyntaxException) KBTestUtil.interceptAndContinue(org.folio.util.KBTestUtil.interceptAndContinue) Autowired(org.springframework.beans.factory.annotation.Autowired) RMAPI_HOLDINGS_STATUS_URL(org.folio.rest.impl.RmApiConstants.RMAPI_HOLDINGS_STATUS_URL) LoadStatusNameEnum(org.folio.rest.jaxrs.model.LoadStatusNameEnum) LoadHoldingsMessage(org.folio.service.holdings.message.LoadHoldingsMessage) HoldingsLoadingStatusFactory.getStatusCompleted(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getStatusCompleted) MockitoAnnotations(org.mockito.MockitoAnnotations) Mockito.doAnswer(org.mockito.Mockito.doAnswer) After(org.junit.After) Spy(org.mockito.Spy) HoldingsStatusUtil.saveStatusNotStarted(org.folio.util.HoldingsStatusUtil.saveStatusNotStarted) JsonObject(io.vertx.core.json.JsonObject) KBTestUtil.clearDataFromTable(org.folio.util.KBTestUtil.clearDataFromTable) KBTestUtil.interceptAndStop(org.folio.util.KBTestUtil.interceptAndStop) HoldingsStatusAuditTestUtil(org.folio.util.HoldingsStatusAuditTestUtil) WireMock.post(com.github.tomakehurst.wiremock.client.WireMock.post) SC_INTERNAL_SERVER_ERROR(org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR) LoadServiceFacade(org.folio.service.holdings.LoadServiceFacade) SNAPSHOT_FAILED_ACTION(org.folio.service.holdings.HoldingConstants.SNAPSHOT_FAILED_ACTION) ResponseDefinitionBuilder(com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder) Matchers.allOf(org.hamcrest.Matchers.allOf) CREATE_SNAPSHOT_ACTION(org.folio.service.holdings.HoldingConstants.CREATE_SNAPSHOT_ACTION) SNAPSHOT_CREATED_ACTION(org.folio.service.holdings.HoldingConstants.SNAPSHOT_CREATED_ACTION) STUB_TENANT(org.folio.test.util.TestUtil.STUB_TENANT) UUID(java.util.UUID) HoldingsService(org.folio.service.holdings.HoldingsService) Collectors(java.util.stream.Collectors) HOLDINGS_SERVICE_ADDRESS(org.folio.service.holdings.HoldingConstants.HOLDINGS_SERVICE_ADDRESS) RequestPatternBuilder(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder) KB_CREDENTIALS_TABLE_NAME(org.folio.repository.kbcredentials.KbCredentialsTableConstants.KB_CREDENTIALS_TABLE_NAME) List(java.util.List) StringValuePattern(com.github.tomakehurst.wiremock.matching.StringValuePattern) OffsetDateTime(java.time.OffsetDateTime) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) Matchers.equalTo(org.hamcrest.Matchers.equalTo) LoadStatusAttributes(org.folio.rest.jaxrs.model.LoadStatusAttributes) Configuration(org.folio.holdingsiq.model.Configuration) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) SC_NO_CONTENT(org.apache.http.HttpStatus.SC_NO_CONTENT) Async(io.vertx.ext.unit.Async) WireMockTestBase(org.folio.rest.impl.WireMockTestBase) HoldingsTestUtil(org.folio.util.HoldingsTestUtil) BeforeClass(org.junit.BeforeClass) RegexPattern(com.github.tomakehurst.wiremock.matching.RegexPattern) RunWith(org.junit.runner.RunWith) CompletableFuture(java.util.concurrent.CompletableFuture) POSTGRES_TIMESTAMP_FORMATTER(org.folio.service.holdings.HoldingsServiceImpl.POSTGRES_TIMESTAMP_FORMATTER) TestUtil.mockResponseList(org.folio.test.util.TestUtil.mockResponseList) ArrayList(java.util.ArrayList) Matchers.hasProperty(org.hamcrest.Matchers.hasProperty) DbHoldingInfo(org.folio.repository.holdings.DbHoldingInfo) COMPLETED(org.folio.rest.jaxrs.model.LoadStatusNameEnum.COMPLETED) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) HoldingsRetryStatusTestUtil.insertRetryStatus(org.folio.util.HoldingsRetryStatusTestUtil.insertRetryStatus) Before(org.junit.Before) InjectMocks(org.mockito.InjectMocks) DeliveryContext(io.vertx.core.eventbus.DeliveryContext) UrlPathPattern(com.github.tomakehurst.wiremock.matching.UrlPathPattern) TestUtil.mockGet(org.folio.test.util.TestUtil.mockGet) PROCESS_ID(org.folio.util.HoldingsStatusUtil.PROCESS_ID) Assert.assertTrue(org.junit.Assert.assertTrue) Matchers(org.hamcrest.Matchers) HoldingsLoadingStatus(org.folio.rest.jaxrs.model.HoldingsLoadingStatus) IOException(java.io.IOException) Test(org.junit.Test) LoadStatusNameDetailEnum(org.folio.rest.jaxrs.model.LoadStatusNameDetailEnum) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) WireMock.verify(com.github.tomakehurst.wiremock.client.WireMock.verify) EqualToPattern(com.github.tomakehurst.wiremock.matching.EqualToPattern) STUB_CREDENTIALS_NAME(org.folio.util.KbCredentialsTestUtil.STUB_CREDENTIALS_NAME) Consumer(java.util.function.Consumer) LOAD_FACADE_ADDRESS(org.folio.service.holdings.HoldingConstants.LOAD_FACADE_ADDRESS) HoldingsStatusRepositoryImpl(org.folio.repository.holdings.status.HoldingsStatusRepositoryImpl) ChronoUnit(java.time.temporal.ChronoUnit) HoldingsStatusUtil.saveStatus(org.folio.util.HoldingsStatusUtil.saveStatus) RetryStatusRepository(org.folio.repository.holdings.status.retry.RetryStatusRepository) HoldingsStatusAuditTestUtil.saveStatusAudit(org.folio.util.HoldingsStatusAuditTestUtil.saveStatusAudit) DateTimeFormatter(java.time.format.DateTimeFormatter) Matcher(org.hamcrest.Matcher) WireMock.stubFor(com.github.tomakehurst.wiremock.client.WireMock.stubFor) SC_CONFLICT(org.apache.http.HttpStatus.SC_CONFLICT) TestUtil.readFile(org.folio.test.util.TestUtil.readFile) RequestMethod(com.github.tomakehurst.wiremock.http.RequestMethod) Handler(io.vertx.core.Handler) SAVE_HOLDINGS_ACTION(org.folio.service.holdings.HoldingConstants.SAVE_HOLDINGS_ACTION) Assert.assertEquals(org.junit.Assert.assertEquals) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) LoadServiceFacade(org.folio.service.holdings.LoadServiceFacade) RegexPattern(com.github.tomakehurst.wiremock.matching.RegexPattern) Async(io.vertx.ext.unit.Async) EqualToPattern(com.github.tomakehurst.wiremock.matching.EqualToPattern) ArrayList(java.util.ArrayList) LoadHoldingsMessage(org.folio.service.holdings.message.LoadHoldingsMessage) HoldingsMessage(org.folio.service.holdings.message.HoldingsMessage) LoadHoldingsMessage(org.folio.service.holdings.message.LoadHoldingsMessage) Test(org.junit.Test)

Example 3 with HoldingsMessage

use of org.folio.service.holdings.message.HoldingsMessage in project mod-kb-ebsco-java by folio-org.

the class HoldingsServiceImpl method saveHolding.

@Override
public void saveHolding(HoldingsMessage holdings) {
    final String tenantId = holdings.getTenantId();
    final UUID credentialsId = toUUID(holdings.getCredentialsId());
    saveHoldings(holdings.getHoldingList(), OffsetDateTime.now(), credentialsId, tenantId).thenCompose(o -> holdingsStatusRepository.increaseImportedCount(holdings.getHoldingList().size(), 1, credentialsId, tenantId)).thenCompose(status -> {
        LoadStatusAttributes attributes = status.getData().getAttributes();
        if (hasLoadedLastPage(status)) {
            return holdingsRepository.deleteBeforeTimestamp(getZonedDateTime(attributes.getStarted()), credentialsId, tenantId).thenCompose(o -> holdingsStatusRepository.update(getStatusCompleted(attributes.getTotalCount()), credentialsId, tenantId)).thenCompose(o -> transactionIdRepository.save(credentialsId, holdings.getTransactionId(), tenantId));
        }
        return CompletableFuture.completedFuture(null);
    }).exceptionally(e -> {
        logger.error(FAILED_SAVE_HOLDINGS_MESSAGE, e);
        return null;
    });
}
Also used : HoldingsLoadingStatusFactory.getStatusLoadingHoldings(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getStatusLoadingHoldings) Arrays(java.util.Arrays) HoldingsMessage(org.folio.service.holdings.message.HoldingsMessage) DeltaReportCreatedMessage(org.folio.service.holdings.message.DeltaReportCreatedMessage) Autowired(org.springframework.beans.factory.annotation.Autowired) HoldingChangeType(org.folio.holdingsiq.model.HoldingChangeType) LoadStatusNameEnum(org.folio.rest.jaxrs.model.LoadStatusNameEnum) HOLDING_UPDATED_ADDED_COVERAGE(org.folio.holdingsiq.model.HoldingChangeType.HOLDING_UPDATED_ADDED_COVERAGE) HoldingsStatusRepository(org.folio.repository.holdings.status.HoldingsStatusRepository) RetryStatus(org.folio.repository.holdings.status.retry.RetryStatus) HoldingsLoadingStatusFactory.getLoadStatusFailed(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getLoadStatusFailed) HoldingsLoadingStatusFactory.getStatusPopulatingStagingArea(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getStatusPopulatingStagingArea) StringUtils(org.apache.commons.lang3.StringUtils) SnapshotCreatedMessage(org.folio.service.holdings.message.SnapshotCreatedMessage) HoldingsLoadingStatusFactory.getStatusCompleted(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getStatusCompleted) Holding(org.folio.holdingsiq.model.Holding) Predicate(java.util.function.Predicate) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) RowSetUtils.toUUID(org.folio.db.RowSetUtils.toUUID) UUID(java.util.UUID) HOLDING_ADDED(org.folio.holdingsiq.model.HoldingChangeType.HOLDING_ADDED) Collectors(java.util.stream.Collectors) Future(io.vertx.core.Future) List(java.util.List) OffsetDateTime(java.time.OffsetDateTime) Stream(java.util.stream.Stream) Logger(org.apache.logging.log4j.Logger) LoadStatusAttributes(org.folio.rest.jaxrs.model.LoadStatusAttributes) RMAPITemplateContext(org.folio.rest.util.template.RMAPITemplateContext) HOLDING_UPDATED(org.folio.holdingsiq.model.HoldingChangeType.HOLDING_UPDATED) HoldingsServiceMessagesFactory.getLoadHoldingsMessage(org.folio.repository.holdings.HoldingsServiceMessagesFactory.getLoadHoldingsMessage) Producer(org.glassfish.jersey.internal.util.Producer) CompletableFuture(java.util.concurrent.CompletableFuture) HoldingsLoadingStatusFactory.getStatusNotStarted(org.folio.repository.holdings.status.HoldingsLoadingStatusFactory.getStatusNotStarted) Function(java.util.function.Function) ProcessInProgressException(org.folio.service.holdings.exception.ProcessInProgressException) ErrorUtil.createError(org.folio.rest.util.ErrorUtil.createError) Value(org.springframework.beans.factory.annotation.Value) HoldingInReport(org.folio.holdingsiq.model.HoldingInReport) HoldingsRepository(org.folio.repository.holdings.HoldingsRepository) DbHoldingInfo(org.folio.repository.holdings.DbHoldingInfo) SnapshotFailedMessage(org.folio.service.holdings.message.SnapshotFailedMessage) AsyncResult(io.vertx.core.AsyncResult) HOLDING_UPDATED_DELETED_COVERAGE(org.folio.holdingsiq.model.HoldingChangeType.HOLDING_UPDATED_DELETED_COVERAGE) FutureUtils.mapVertxFuture(org.folio.util.FutureUtils.mapVertxFuture) FutureUtils.failedFuture(org.folio.util.FutureUtils.failedFuture) LoadFailedMessage(org.folio.service.holdings.message.LoadFailedMessage) Promise(io.vertx.core.Promise) DeltaReportMessage(org.folio.service.holdings.message.DeltaReportMessage) Vertx(io.vertx.core.Vertx) HoldingsLoadingStatus(org.folio.rest.jaxrs.model.HoldingsLoadingStatus) Integer.parseInt(java.lang.Integer.parseInt) Component(org.springframework.stereotype.Component) HoldingsId(org.folio.repository.holdings.HoldingsId) ChronoUnit(java.time.temporal.ChronoUnit) Lock(io.vertx.core.shareddata.Lock) LoadStatusInformation(org.folio.rest.jaxrs.model.LoadStatusInformation) RetryStatusRepository(org.folio.repository.holdings.status.retry.RetryStatusRepository) DateTimeFormatter(java.time.format.DateTimeFormatter) ConfigurationMessage(org.folio.service.holdings.message.ConfigurationMessage) TransactionIdRepository(org.folio.repository.holdings.transaction.TransactionIdRepository) HOLDING_DELETED(org.folio.holdingsiq.model.HoldingChangeType.HOLDING_DELETED) Handler(io.vertx.core.Handler) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) LoadStatusAttributes(org.folio.rest.jaxrs.model.LoadStatusAttributes) RowSetUtils.toUUID(org.folio.db.RowSetUtils.toUUID) UUID(java.util.UUID)

Aggregations

Handler (io.vertx.core.Handler)3 OffsetDateTime (java.time.OffsetDateTime)3 ChronoUnit (java.time.temporal.ChronoUnit)3 List (java.util.List)3 UUID (java.util.UUID)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 Collectors (java.util.stream.Collectors)3 DbHoldingInfo (org.folio.repository.holdings.DbHoldingInfo)3 RetryStatusRepository (org.folio.repository.holdings.status.retry.RetryStatusRepository)3 ResponseDefinitionBuilder (com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder)2 WireMock.post (com.github.tomakehurst.wiremock.client.WireMock.post)2 WireMock.stubFor (com.github.tomakehurst.wiremock.client.WireMock.stubFor)2 WireMock.verify (com.github.tomakehurst.wiremock.client.WireMock.verify)2 RequestMethod (com.github.tomakehurst.wiremock.http.RequestMethod)2 EqualToPattern (com.github.tomakehurst.wiremock.matching.EqualToPattern)2 RegexPattern (com.github.tomakehurst.wiremock.matching.RegexPattern)2 RequestPatternBuilder (com.github.tomakehurst.wiremock.matching.RequestPatternBuilder)2 StringValuePattern (com.github.tomakehurst.wiremock.matching.StringValuePattern)2 UrlPathPattern (com.github.tomakehurst.wiremock.matching.UrlPathPattern)2 DeliveryContext (io.vertx.core.eventbus.DeliveryContext)2