Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
azizbekxm committed Nov 5, 2024
1 parent 73d713a commit a351474
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ramls/acq-models
2 changes: 1 addition & 1 deletion ramls/fund_update_log.raml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resourceTypes:
get:
description: Get list of fund update logs
is: [
searchable: {description: "with valid searchable fields: for example jobName", example: "[\"jobName\", \"allocation update\", \"=\"]"},
searchable: {description: "with valid searchable fields: for example jobName", example: "[\"jobName\", \"fund update\", \"=\"]"},
pageable
]
/{id}:
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/templates/db_scripts/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@
{
"tableName": "fund_update_log",
"fromModuleVersion": "mod-finance-storage-8.7.0",
"withMetadata": true
"withMetadata": true,
"withOptimisticLocking": "failOnConflict"
}
]
}
3 changes: 2 additions & 1 deletion src/test/java/org/folio/rest/impl/EntitiesCrudTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static org.folio.rest.utils.TestEntities.FISCAL_YEAR;
import static org.folio.rest.utils.TestEntities.FUND;
import static org.folio.rest.utils.TestEntities.FUND_TYPE;
import static org.folio.rest.utils.TestEntities.FUND_UPDATE_LOG;
import static org.folio.rest.utils.TestEntities.GROUP;
import static org.folio.rest.utils.TestEntities.GROUP_FUND_FY;
import static org.folio.rest.utils.TestEntities.LEDGER;
Expand Down Expand Up @@ -51,7 +52,7 @@ public class EntitiesCrudTest extends TestBase {
*/
static Stream<TestEntities> deleteOrder() {
return Stream.of(GROUP_FUND_FY, BUDGET_EXPENSE_CLASS, BUDGET, LEDGER_FISCAL_YEAR_ROLLOVER_ERROR,
LEDGER_FISCAL_YEAR_ROLLOVER, FUND, FUND_TYPE, LEDGER, FISCAL_YEAR, GROUP, EXPENSE_CLASS);
LEDGER_FISCAL_YEAR_ROLLOVER, FUND, FUND_TYPE, LEDGER, FISCAL_YEAR, GROUP, EXPENSE_CLASS, FUND_UPDATE_LOG);
}

static Stream<TestEntities> deleteFailOrder() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/folio/rest/utils/TestEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public enum TestEntities {
LEDGER_FISCAL_YEAR_ROLLOVER(HelperUtils.getEndpoint(FinanceStorageLedgerRollovers.class), LedgerFiscalYearRollover.class, "data/ledger-fiscal-year-rollovers/", "main-library.json", "restrictEncumbrance", "true", 0, true),
LEDGER_FISCAL_YEAR_ROLLOVER_LOG(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversLogs.class), LedgerFiscalYearRolloverLog.class, null, null, null, null, 0, false),
LEDGER_FISCAL_YEAR_ROLLOVER_PROGRESS(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversProgress.class), LedgerFiscalYearRolloverProgress.class, "data/ledger-fiscal-year-rollovers/", "main-library-progress.json", "financialRolloverStatus", "Success", 0, false),
LEDGER_FISCAL_YEAR_ROLLOVER_ERROR(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversErrors.class), LedgerFiscalYearRolloverError.class, "data/ledger-fiscal-year-rollovers/", "main-library-errors.json", "errorType", "Fund", 0, false);

LEDGER_FISCAL_YEAR_ROLLOVER_ERROR(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversErrors.class), LedgerFiscalYearRolloverError.class, "data/ledger-fiscal-year-rollovers/", "main-library-errors.json", "errorType", "Fund", 0, false),
FUND_UPDATE_LOG(HelperUtils.getEndpoint(FinanceStorageFundUpdateLogs.class), FundUpdateLog.class, "data/fund-update-log/", "monthly-fund-update.json", "jobName", "Weekly Fund Update", 0, true);

TestEntities(String endpoint, Class<?> clazz, String pathToSamples, String sampleFileName, String updatedFieldName,
String updatedFieldValue, int initialQuantity, boolean isOptLockingEnabled) {
Expand Down
12 changes: 12 additions & 0 deletions src/test/resources/data/fund-update-log/monthly-fund-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"jobNumber": 1,
"jobName": "Monthly Fund Update",
"jobDetails": {
"description": "Updating fund details for the month",
"startTime": "2023-10-01T00:00:00Z",
"endTime": "2023-10-01T01:00:00Z"
},
"status": "COMPLETED",
"recordsCount": 100
}

0 comments on commit a351474

Please sign in to comment.