Search in sources :

Example 1 with Piece

use of org.folio.rest.acq.model.Piece in project mod-orders by folio-org.

the class MockServer method handleGetPieces.

private void handleGetPieces(RoutingContext ctx) {
    logger.info("handleGetPieces got: " + ctx.request().path());
    String query = ctx.request().getParam("query");
    if (query.contains(ID_FOR_PIECES_INTERNAL_SERVER_ERROR)) {
        addServerRqRsData(HttpMethod.GET, PIECES_STORAGE, new JsonObject());
        serverResponse(ctx, 500, APPLICATION_JSON, Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase());
    } else {
        PieceCollection pieces;
        if (getMockEntries(PIECES_STORAGE, Piece.class).isPresent()) {
            pieces = new PieceCollection().withPieces(getMockEntries(PIECES_STORAGE, Piece.class).get());
            pieces.setTotalRecords(pieces.getPieces().size());
        } else {
            try {
                if (query.contains("poLineId==")) {
                    List<String> conditions = StreamEx.split(query, " or ").flatMap(s -> StreamEx.split(s, " and ")).toList();
                    String polId = EMPTY;
                    String status = EMPTY;
                    for (String condition : conditions) {
                        if (condition.startsWith("poLineId")) {
                            polId = condition.split("poLineId==")[1];
                        } else if (condition.startsWith("receivingStatus")) {
                            status = condition.split("receivingStatus==")[1];
                        }
                    }
                    logger.info("poLineId: " + polId);
                    logger.info("receivingStatus: " + status);
                    String path = PIECE_RECORDS_MOCK_DATA_PATH + String.format("pieceRecords-%s.json", polId);
                    pieces = new JsonObject(getMockData(path)).mapTo(PieceCollection.class);
                    // Filter piece records by receiving status
                    if (StringUtils.isNotEmpty(status)) {
                        Piece.ReceivingStatus receivingStatus = Piece.ReceivingStatus.fromValue(status);
                        pieces.getPieces().removeIf(piece -> receivingStatus != piece.getReceivingStatus());
                    }
                } else if (query.contains("id==")) {
                    pieces = new JsonObject(getMockData(PIECE_RECORDS_MOCK_DATA_PATH + "pieceRecordsCollection.json")).mapTo(PieceCollection.class);
                    // if (query.contains("id==")) {
                    List<String> pieceIds = extractIdsFromQuery(query);
                    pieces.getPieces().removeIf(piece -> !pieceIds.contains(piece.getId()));
                    // fix consistency with titles: the piece's title id should be the same as one of the titles ids
                    // returned for the piece's po line
                    pieces.getPieces().forEach(piece -> {
                        String poLineId = piece.getPoLineId();
                        List<Title> titlesForPoLine = getTitlesByPoLineIds(List.of(poLineId)).mapTo(TitleCollection.class).getTitles();
                        if (titlesForPoLine.size() > 0 && titlesForPoLine.stream().noneMatch(title -> title.getId().equals(piece.getTitleId())))
                            piece.setTitleId(titlesForPoLine.get(0).getId());
                    });
                } else {
                    pieces = new PieceCollection();
                }
                pieces.setTotalRecords(pieces.getPieces().size());
            } catch (Exception e) {
                pieces = new PieceCollection();
                pieces.setTotalRecords(0);
            }
        }
        JsonObject data = JsonObject.mapFrom(pieces);
        addServerRqRsData(HttpMethod.GET, PIECES_STORAGE, data);
        ctx.response().setStatusCode(200).putHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON).end(data.encodePrettily());
    }
}
Also used : Arrays(java.util.Arrays) TestConstants(org.folio.TestConstants) LISTED_PRINT_MONOGRAPH_PATH(org.folio.rest.impl.PurchaseOrdersApiTest.LISTED_PRINT_MONOGRAPH_PATH) HttpServer(io.vertx.core.http.HttpServer) Header(io.restassured.http.Header) HashBasedTable(com.google.common.collect.HashBasedTable) FUND_ID(org.folio.orders.utils.HelperUtils.FUND_ID) StringUtils(org.apache.commons.lang3.StringUtils) TransactionCollection(org.folio.rest.acq.model.finance.TransactionCollection) REQUESTS(org.folio.service.inventory.InventoryManager.REQUESTS) Matcher(java.util.regex.Matcher) HelperUtils.convertIdsToCqlQuery(org.folio.orders.utils.HelperUtils.convertIdsToCqlQuery) JsonObject(io.vertx.core.json.JsonObject) PURCHASE_ORDER_ID(org.folio.rest.impl.PurchaseOrdersApiTest.PURCHASE_ORDER_ID) Budget(org.folio.rest.acq.model.finance.Budget) REASON_FOR_CLOSURE(org.folio.rest.impl.crud.CrudTestEntities.REASON_FOR_CLOSURE) Ledger(org.folio.rest.acq.model.finance.Ledger) Fund(org.folio.rest.acq.model.finance.Fund) Title(org.folio.rest.acq.model.Title) ORGANIZATION_NOT_VENDOR(org.folio.rest.impl.PurchaseOrdersApiTest.ORGANIZATION_NOT_VENDOR) TestUtils.encodePrettily(org.folio.TestUtils.encodePrettily) INACTIVE_VENDOR_ID(org.folio.rest.impl.PurchaseOrdersApiTest.INACTIVE_VENDOR_ID) Logger(org.apache.logging.log4j.Logger) Assertions.fail(org.assertj.core.api.Assertions.fail) BUDGET_IS_INACTIVE(org.folio.rest.core.exceptions.ErrorCodes.BUDGET_IS_INACTIVE) TEXT_PLAIN(javax.ws.rs.core.MediaType.TEXT_PLAIN) VENDOR_WITH_BAD_CONTENT(org.folio.rest.impl.PurchaseOrdersApiTest.VENDOR_WITH_BAD_CONTENT) ACQUISITIONS_UNIT_ID(org.folio.service.ProtectionService.ACQUISITIONS_UNIT_ID) Transaction(org.folio.rest.acq.model.finance.Transaction) Supplier(java.util.function.Supplier) BudgetCollection(org.folio.rest.acq.model.finance.BudgetCollection) ArrayList(java.util.ArrayList) StringUtils.isNotEmpty(org.apache.commons.lang3.StringUtils.isNotEmpty) NONEXISTING_PO_NUMBER(org.folio.rest.impl.PoNumberApiTest.NONEXISTING_PO_NUMBER) Lists(com.google.common.collect.Lists) ExchangeRate(org.folio.rest.acq.model.finance.ExchangeRate) ITEMS_NOT_FOUND(org.folio.rest.impl.PurchaseOrdersApiTest.ITEMS_NOT_FOUND) SequenceNumbers(org.folio.rest.acq.model.SequenceNumbers) ExpenseClassCollection(org.folio.rest.acq.model.finance.ExpenseClassCollection) ONLY_NEW_HOLDING_EXIST_ID(org.folio.service.inventory.InventoryManagerTest.ONLY_NEW_HOLDING_EXIST_ID) INTERNAL_SERVER_ERROR(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR) EXISTING_PO_NUMBER(org.folio.rest.impl.PoNumberApiTest.EXISTING_PO_NUMBER) Vertx(io.vertx.core.Vertx) IOException(java.io.IOException) BUDGET_NOT_FOUND_FOR_TRANSACTION(org.folio.rest.core.exceptions.ErrorCodes.BUDGET_NOT_FOUND_FOR_TRANSACTION) COMPOSITE_PO_LINES(org.folio.orders.utils.HelperUtils.COMPOSITE_PO_LINES) ExecutionException(java.util.concurrent.ExecutionException) JsonArray(io.vertx.core.json.JsonArray) DAYS(java.time.temporal.ChronoUnit.DAYS) IsbnUtil(org.folio.isbn.IsbnUtil) Piece(org.folio.rest.acq.model.Piece) BudgetExpenseClassCollection(org.folio.rest.acq.model.finance.BudgetExpenseClassCollection) TestUtils.getMinimalContentCompositePoLine(org.folio.TestUtils.getMinimalContentCompositePoLine) TestUtils.getMockAsJson(org.folio.TestUtils.getMockAsJson) AbstractHelper(org.folio.helper.AbstractHelper) NoSuchFileException(java.nio.file.NoSuchFileException) FUND_CANNOT_BE_PAID(org.folio.rest.core.exceptions.ErrorCodes.FUND_CANNOT_BE_PAID) Date(java.util.Date) DEFAULT_POLINE_LIMIT(org.folio.orders.utils.HelperUtils.DEFAULT_POLINE_LIMIT) Router(io.vertx.ext.web.Router) TimeoutException(java.util.concurrent.TimeoutException) RoutingContext(io.vertx.ext.web.RoutingContext) BodyHandler(io.vertx.ext.web.handler.BodyHandler) SequenceNumber(org.folio.rest.acq.model.SequenceNumber) OrderInvoiceRelationshipCollection(org.folio.rest.acq.model.OrderInvoiceRelationshipCollection) NEW_LOCATION_ID(org.folio.service.inventory.InventoryManagerTest.NEW_LOCATION_ID) InvoiceLineCollection(org.folio.rest.acq.model.invoice.InvoiceLineCollection) TestUtils.getMinimalContentCompositePurchaseOrder(org.folio.TestUtils.getMinimalContentCompositePurchaseOrder) APPLICATION_JSON(javax.ws.rs.core.MediaType.APPLICATION_JSON) HOLDING_INSTANCE_ID_2_HOLDING(org.folio.service.inventory.InventoryManagerTest.HOLDING_INSTANCE_ID_2_HOLDING) OLD_LOCATION_ID(org.folio.service.inventory.InventoryManagerTest.OLD_LOCATION_ID) LEDGER_NOT_FOUND_FOR_TRANSACTION(org.folio.rest.core.exceptions.ErrorCodes.LEDGER_NOT_FOUND_FOR_TRANSACTION) HttpHeaders(io.vertx.core.http.HttpHeaders) UUID(java.util.UUID) Instant(java.time.Instant) Tag(org.folio.rest.acq.model.tag.Tag) Collectors(java.util.stream.Collectors) FUND_ENCUMBRANCE_ERROR(org.folio.rest.impl.PurchaseOrdersApiTest.FUND_ENCUMBRANCE_ERROR) Objects(java.util.Objects) List(java.util.List) Response(javax.ws.rs.core.Response) ACTIVE_VENDOR_ID(org.folio.rest.impl.PurchaseOrdersApiTest.ACTIVE_VENDOR_ID) StreamEx(one.util.streamex.StreamEx) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) NON_EXIST_VENDOR_ID(org.folio.rest.impl.PurchaseOrdersApiTest.NON_EXIST_VENDOR_ID) PieceCollection(org.folio.rest.acq.model.PieceCollection) MOD_VENDOR_INTERNAL_ERROR_ID(org.folio.rest.impl.PurchaseOrdersApiTest.MOD_VENDOR_INTERNAL_ERROR_ID) HttpException(org.folio.rest.core.exceptions.HttpException) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) OKAPI_HEADER_TENANT(org.folio.rest.RestVerticle.OKAPI_HEADER_TENANT) FiscalYear(org.folio.rest.acq.model.finance.FiscalYear) TestUtils.getMockData(org.folio.TestUtils.getMockData) LedgerCollection(org.folio.rest.acq.model.finance.LedgerCollection) ITEM_PURCHASE_ORDER_LINE_IDENTIFIER(org.folio.service.inventory.InventoryManager.ITEM_PURCHASE_ORDER_LINE_IDENTIFIER) OrderTransactionSummary(org.folio.rest.acq.model.finance.OrderTransactionSummary) TestUtils.getTitle(org.folio.TestUtils.getTitle) Encumbrance(org.folio.rest.acq.model.finance.Encumbrance) EMPTY(org.apache.commons.lang3.StringUtils.EMPTY) ITEMS(org.folio.service.inventory.InventoryManager.ITEMS) Iterator(java.util.Iterator) PREFIX(org.folio.rest.impl.crud.CrudTestEntities.PREFIX) org.folio.rest.jaxrs.model(org.folio.rest.jaxrs.model) TimeUnit(java.util.concurrent.TimeUnit) Error(org.folio.rest.jaxrs.model.Error) SUFFIX(org.folio.rest.impl.crud.CrudTestEntities.SUFFIX) Collectors.toList(java.util.stream.Collectors.toList) ID_FOR_PRINT_MONOGRAPH_ORDER(org.folio.rest.impl.PurchaseOrdersApiTest.ID_FOR_PRINT_MONOGRAPH_ORDER) HttpMethod(io.vertx.core.http.HttpMethod) HelperUtils.calculateEstimatedPrice(org.folio.orders.utils.HelperUtils.calculateEstimatedPrice) HttpStatus(org.folio.HttpStatus) RECEIVING_HISTORY_PURCHASE_ORDER_ID(org.folio.rest.impl.ReceivingHistoryApiTest.RECEIVING_HISTORY_PURCHASE_ORDER_ID) FundCollection(org.folio.rest.acq.model.finance.FundCollection) InvoiceLine(org.folio.rest.acq.model.invoice.InvoiceLine) Table(com.google.common.collect.Table) LogManager(org.apache.logging.log4j.LogManager) TitleCollection(org.folio.rest.acq.model.TitleCollection) Collections(java.util.Collections) ResourcePathResolver(org.folio.orders.utils.ResourcePathResolver) ORDER_DELETE_ERROR_TENANT(org.folio.rest.impl.PurchaseOrdersApiTest.ORDER_DELETE_ERROR_TENANT) NON_EXISTED_NEW_HOLDING_ID(org.folio.service.inventory.InventoryManagerTest.NON_EXISTED_NEW_HOLDING_ID) PieceCollection(org.folio.rest.acq.model.PieceCollection) Piece(org.folio.rest.acq.model.Piece) JsonObject(io.vertx.core.json.JsonObject) ArrayList(java.util.ArrayList) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) NoSuchFileException(java.nio.file.NoSuchFileException) TimeoutException(java.util.concurrent.TimeoutException) HttpException(org.folio.rest.core.exceptions.HttpException)

Example 2 with Piece

use of org.folio.rest.acq.model.Piece in project mod-orders by folio-org.

the class ReceiptStatusConsistencyTest method testSuccessFullyReceivedStatusWhenAllPiecesSuccessfullyReceived.

@Test
void testSuccessFullyReceivedStatusWhenAllPiecesSuccessfullyReceived(VertxTestContext context) throws Throwable {
    logger.info("=== Test case to verify fully received status when all pieces successfully received ===");
    CompositePoLine compositePoLine = getMockAsJson(PO_LINES_MOCK_DATA_PATH, POLINE_UUID_TIED_TO_PIECE_FULLY_RECEIVED).mapTo(CompositePoLine.class);
    MockServer.addMockTitles(Collections.singletonList(compositePoLine));
    sendEvent(createBody(POLINE_UUID_TIED_TO_PIECE_FULLY_RECEIVED), context.succeeding(result -> {
        logger.info("getPoLineSearches()--->" + getPoLineSearches());
        logger.info("getPoLineUpdates()--->" + getPoLineUpdates());
        logger.info("getPieceSearches()--->" + getPieceSearches());
        assertEquals(5, getPieceSearches().get(0).getJsonArray("pieces").size());
        Piece piece0 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(0).mapTo(Piece.class);
        Piece piece1 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(1).mapTo(Piece.class);
        Piece piece2 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(2).mapTo(Piece.class);
        Piece piece3 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(3).mapTo(Piece.class);
        Piece piece4 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(4).mapTo(Piece.class);
        assertEquals(ReceivingStatus.RECEIVED, piece0.getReceivingStatus());
        assertEquals(ReceivingStatus.RECEIVED, piece1.getReceivingStatus());
        assertEquals(ReceivingStatus.RECEIVED, piece2.getReceivingStatus());
        assertEquals(ReceivingStatus.RECEIVED, piece3.getReceivingStatus());
        assertEquals(ReceivingStatus.RECEIVED, piece4.getReceivingStatus());
        PoLine poLine = getPoLineUpdates().get(0).mapTo(PoLine.class);
        assertEquals(ReceiptStatus.FULLY_RECEIVED, poLine.getReceiptStatus());
        assertEquals(result.body(), Response.Status.OK.getReasonPhrase());
        context.completeNow();
    }));
    checkVertxContextCompletion(context);
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) TestUtils.checkVertxContextCompletion(org.folio.TestUtils.checkVertxContextCompletion) BeforeEach(org.junit.jupiter.api.BeforeEach) DeliveryOptions(io.vertx.core.eventbus.DeliveryOptions) TimeoutException(java.util.concurrent.TimeoutException) Autowired(org.springframework.beans.factory.annotation.Autowired) PoLine(org.folio.rest.acq.model.PoLine) SpringContextUtil(org.folio.spring.SpringContextUtil) ApiTestSuite(org.folio.ApiTestSuite) AfterAll(org.junit.jupiter.api.AfterAll) MockServer(org.folio.rest.impl.MockServer) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) BeforeAll(org.junit.jupiter.api.BeforeAll) Matchers.nullValue(org.hamcrest.Matchers.nullValue) PO_LINES_MOCK_DATA_PATH(org.folio.rest.impl.MockServer.PO_LINES_MOCK_DATA_PATH) JsonObject(io.vertx.core.json.JsonObject) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AsyncResult(io.vertx.core.AsyncResult) TestConfig.clearServiceInteractions(org.folio.TestConfig.clearServiceInteractions) MockServer.getPieceSearches(org.folio.rest.impl.MockServer.getPieceSearches) Vertx(io.vertx.core.Vertx) Message(io.vertx.core.eventbus.Message) X_OKAPI_URL(org.folio.TestConfig.X_OKAPI_URL) VertxExtension(io.vertx.junit5.VertxExtension) MockServer.getPoLineSearches(org.folio.rest.impl.MockServer.getPoLineSearches) TestConfig.isVerticleNotDeployed(org.folio.TestConfig.isVerticleNotDeployed) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) ExecutionException(java.util.concurrent.ExecutionException) ReceiptStatus(org.folio.rest.acq.model.PoLine.ReceiptStatus) Test(org.junit.jupiter.api.Test) ReceivingStatus(org.folio.rest.acq.model.Piece.ReceivingStatus) AfterEach(org.junit.jupiter.api.AfterEach) Logger(org.apache.logging.log4j.Logger) Response(javax.ws.rs.core.Response) Piece(org.folio.rest.acq.model.Piece) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) MockServer.getPoLineUpdates(org.folio.rest.impl.MockServer.getPoLineUpdates) ApplicationConfig(org.folio.config.ApplicationConfig) PurchaseOrderLineService(org.folio.service.orders.PurchaseOrderLineService) Matchers.is(org.hamcrest.Matchers.is) POLINES_COLLECTION(org.folio.rest.impl.MockServer.POLINES_COLLECTION) Handler(io.vertx.core.Handler) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) TestUtils.getMockAsJson(org.folio.TestUtils.getMockAsJson) ReplyException(io.vertx.core.eventbus.ReplyException) Piece(org.folio.rest.acq.model.Piece) PoLine(org.folio.rest.acq.model.PoLine) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) Test(org.junit.jupiter.api.Test)

Example 3 with Piece

use of org.folio.rest.acq.model.Piece in project mod-orders by folio-org.

the class ReceiptStatusConsistencyTest method testSuccessPartiallyReceivedStatusWhenAtleastOneSuccessfullyReceivedPiece.

@Test
void testSuccessPartiallyReceivedStatusWhenAtleastOneSuccessfullyReceivedPiece(VertxTestContext context) throws Throwable {
    logger.info("=== Test case to verify partially received status when at least one successfully received piece ===");
    CompositePoLine compositePoLine = getMockAsJson(POLINES_COLLECTION).getJsonArray("poLines").getJsonObject(5).mapTo(CompositePoLine.class);
    MockServer.addMockTitles(Collections.singletonList(compositePoLine));
    sendEvent(createBody(POLINE_UUID_TIED_TO_PIECE_PARTIALLY_RECEIVED), context.succeeding(result -> {
        logger.info("getPoLineSearches()--->" + getPoLineSearches());
        logger.info("getPoLineUpdates()--->" + getPoLineUpdates());
        logger.info("getPieceSearches()--->" + getPieceSearches());
        assertEquals(5, getPieceSearches().get(0).getJsonArray("pieces").size());
        Piece piece0 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(0).mapTo(Piece.class);
        Piece piece1 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(1).mapTo(Piece.class);
        Piece piece2 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(2).mapTo(Piece.class);
        Piece piece3 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(3).mapTo(Piece.class);
        Piece piece4 = getPieceSearches().get(0).getJsonArray("pieces").getJsonObject(4).mapTo(Piece.class);
        assertEquals(ReceivingStatus.RECEIVED, piece0.getReceivingStatus());
        assertEquals(ReceivingStatus.EXPECTED, piece1.getReceivingStatus());
        assertEquals(ReceivingStatus.EXPECTED, piece2.getReceivingStatus());
        assertEquals(ReceivingStatus.EXPECTED, piece3.getReceivingStatus());
        assertEquals(ReceivingStatus.EXPECTED, piece4.getReceivingStatus());
        PoLine poLine = getPoLineUpdates().get(0).mapTo(PoLine.class);
        assertEquals(ReceiptStatus.PARTIALLY_RECEIVED, poLine.getReceiptStatus());
        assertEquals(result.body(), Response.Status.OK.getReasonPhrase());
        context.completeNow();
    }));
    checkVertxContextCompletion(context);
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) TestUtils.checkVertxContextCompletion(org.folio.TestUtils.checkVertxContextCompletion) BeforeEach(org.junit.jupiter.api.BeforeEach) DeliveryOptions(io.vertx.core.eventbus.DeliveryOptions) TimeoutException(java.util.concurrent.TimeoutException) Autowired(org.springframework.beans.factory.annotation.Autowired) PoLine(org.folio.rest.acq.model.PoLine) SpringContextUtil(org.folio.spring.SpringContextUtil) ApiTestSuite(org.folio.ApiTestSuite) AfterAll(org.junit.jupiter.api.AfterAll) MockServer(org.folio.rest.impl.MockServer) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) BeforeAll(org.junit.jupiter.api.BeforeAll) Matchers.nullValue(org.hamcrest.Matchers.nullValue) PO_LINES_MOCK_DATA_PATH(org.folio.rest.impl.MockServer.PO_LINES_MOCK_DATA_PATH) JsonObject(io.vertx.core.json.JsonObject) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AsyncResult(io.vertx.core.AsyncResult) TestConfig.clearServiceInteractions(org.folio.TestConfig.clearServiceInteractions) MockServer.getPieceSearches(org.folio.rest.impl.MockServer.getPieceSearches) Vertx(io.vertx.core.Vertx) Message(io.vertx.core.eventbus.Message) X_OKAPI_URL(org.folio.TestConfig.X_OKAPI_URL) VertxExtension(io.vertx.junit5.VertxExtension) MockServer.getPoLineSearches(org.folio.rest.impl.MockServer.getPoLineSearches) TestConfig.isVerticleNotDeployed(org.folio.TestConfig.isVerticleNotDeployed) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) ExecutionException(java.util.concurrent.ExecutionException) ReceiptStatus(org.folio.rest.acq.model.PoLine.ReceiptStatus) Test(org.junit.jupiter.api.Test) ReceivingStatus(org.folio.rest.acq.model.Piece.ReceivingStatus) AfterEach(org.junit.jupiter.api.AfterEach) Logger(org.apache.logging.log4j.Logger) Response(javax.ws.rs.core.Response) Piece(org.folio.rest.acq.model.Piece) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) MockServer.getPoLineUpdates(org.folio.rest.impl.MockServer.getPoLineUpdates) ApplicationConfig(org.folio.config.ApplicationConfig) PurchaseOrderLineService(org.folio.service.orders.PurchaseOrderLineService) Matchers.is(org.hamcrest.Matchers.is) POLINES_COLLECTION(org.folio.rest.impl.MockServer.POLINES_COLLECTION) Handler(io.vertx.core.Handler) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) TestUtils.getMockAsJson(org.folio.TestUtils.getMockAsJson) ReplyException(io.vertx.core.eventbus.ReplyException) Piece(org.folio.rest.acq.model.Piece) PoLine(org.folio.rest.acq.model.PoLine) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) Test(org.junit.jupiter.api.Test)

Aggregations

Vertx (io.vertx.core.Vertx)3 JsonObject (io.vertx.core.json.JsonObject)3 Collections (java.util.Collections)3 ExecutionException (java.util.concurrent.ExecutionException)3 TimeoutException (java.util.concurrent.TimeoutException)3 Response (javax.ws.rs.core.Response)3 LogManager (org.apache.logging.log4j.LogManager)3 Logger (org.apache.logging.log4j.Logger)3 TestUtils.getMockAsJson (org.folio.TestUtils.getMockAsJson)3 Piece (org.folio.rest.acq.model.Piece)3 AsyncResult (io.vertx.core.AsyncResult)2 Handler (io.vertx.core.Handler)2 DeliveryOptions (io.vertx.core.eventbus.DeliveryOptions)2 Message (io.vertx.core.eventbus.Message)2 ReplyException (io.vertx.core.eventbus.ReplyException)2 VertxExtension (io.vertx.junit5.VertxExtension)2 VertxTestContext (io.vertx.junit5.VertxTestContext)2 HashBasedTable (com.google.common.collect.HashBasedTable)1 Lists (com.google.common.collect.Lists)1 Table (com.google.common.collect.Table)1