(t *testing.T)
| 5532 | } |
| 5533 | |
| 5534 | func TestCreateBulkTransactionsSyncAtomicSuccess(t *testing.T) { |
| 5535 | // Skip in short mode |
| 5536 | if testing.Short() { |
| 5537 | t.Skip("Skipping bulk transaction test in short mode") |
| 5538 | } |
| 5539 | |
| 5540 | ctx := context.Background() |
| 5541 | cnf := &config.Configuration{ |
| 5542 | Redis: config.RedisConfig{ |
| 5543 | Dns: "localhost:6379", |
| 5544 | }, |
| 5545 | DataSource: config.DataSourceConfig{ |
| 5546 | Dns: "postgres://postgres:password@localhost:5432/ledgerforge?sslmode=disable", |
| 5547 | }, |
| 5548 | Queue: config.QueueConfig{ |
| 5549 | WebhookQueue: "webhook_queue_test_bulk_atomic", |
| 5550 | IndexQueue: "index_queue_test_bulk_atomic", |
| 5551 | TransactionQueue: "transaction_queue_test_bulk_atomic", |
| 5552 | NumberOfQueues: 1, |
| 5553 | }, |
| 5554 | Server: config.ServerConfig{ |
| 5555 | SecretKey: "test-secret", |
| 5556 | }, |
| 5557 | Transaction: config.TransactionConfig{ |
| 5558 | BatchSize: 100, |
| 5559 | MaxQueueSize: 1000, |
| 5560 | LockDuration: time.Second * 30, |
| 5561 | IndexQueuePrefix: "test_index", |
| 5562 | }, |
| 5563 | } |
| 5564 | config.ConfigStore.Store(cnf) |
| 5565 | |
| 5566 | ds, err := database.NewDataSource(cnf) |
| 5567 | require.NoError(t, err, "Failed to create datasource") |
| 5568 | |
| 5569 | ledgerforge, err := NewLedgerForge(ds) |
| 5570 | require.NoError(t, err, "Failed to create LedgerForge instance") |
| 5571 | |
| 5572 | // Create test balances |
| 5573 | sourceBalance := &model.Balance{ |
| 5574 | Currency: "USD", |
| 5575 | LedgerID: "general_ledger_id", |
| 5576 | } |
| 5577 | destBalance1 := &model.Balance{ |
| 5578 | Currency: "USD", |
| 5579 | LedgerID: "general_ledger_id", |
| 5580 | } |
| 5581 | destBalance2 := &model.Balance{ |
| 5582 | Currency: "USD", |
| 5583 | LedgerID: "general_ledger_id", |
| 5584 | } |
| 5585 | |
| 5586 | source, err := ds.CreateBalance(*sourceBalance) |
| 5587 | require.NoError(t, err, "Failed to create source balance") |
| 5588 | |
| 5589 | dest1, err := ds.CreateBalance(*destBalance1) |
| 5590 | require.NoError(t, err, "Failed to create destination balance 1") |
| 5591 |
nothing calls this directly
no test coverage detected