"use strict";
// SPDX-License-Identifier: Apache-2.0
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ts_jest_1 = require("@golevelup/ts-jest");
const request_1 = require("../../request");
const DataFixture_1 = require("../../../../../__tests__/fixtures/shared/DataFixture");
const LogService_1 = __importDefault(require("../../../../app/service/log/LogService"));
const ValidatedArgs_1 = __importDefault(require("../../../../core/validation/ValidatedArgs"));
const ValidationError_1 = require("../../../../core/validation/ValidationError");
const Security_1 = __importDefault(require("../../../in/security/Security"));
const TransferFixture_1 = require("../../../../../__tests__/fixtures/transfer/TransferFixture");
const TransferCommand_1 = require("../../../../app/usecase/command/security/operations/transfer/TransferCommand");
const TransferAndLockCommand_1 = require("../../../../app/usecase/command/security/operations/transfer/TransferAndLockCommand");
const ControllerTransferCommand_1 = require("../../../../app/usecase/command/security/operations/transfer/ControllerTransferCommand");
const ProtectedPartitionsFixture_1 = require("../../../../../__tests__/fixtures/protectedPartitions/ProtectedPartitionsFixture");
const ProtectedTransferFromByPartitionCommand_1 = require("../../../../app/usecase/command/security/operations/transfer/ProtectedTransferFromByPartitionCommand");
const BatchForcedTransferCommand_1 = require("../../../../app/usecase/command/security/operations/batch/batchForcedTransfer/BatchForcedTransferCommand");
const BatchTransferCommand_1 = require("../../../../app/usecase/command/security/operations/batch/batchTransfer/BatchTransferCommand");
const ForcedTransferCommand_1 = require("../../../../app/usecase/command/security/operations/transfer/ForcedTransferCommand");
const BatchFixture_1 = require("../../../../../__tests__/fixtures/batch/BatchFixture");
describe("Transfer", () => {
    let commandBusMock;
    let queryBusMock;
    let mirrorNodeMock;
    let transferRequest;
    let transferAndLockRequest;
    let forceTransferRequest;
    let forcedTransferRequest;
    let protectedTransferFromByPartitionRequest;
    let batchTransferRequest;
    let batchForcedTransferRequest;
    let handleValidationSpy;
    const transactionId = DataFixture_1.TransactionIdFixture.create().id;
    beforeEach(() => {
        commandBusMock = (0, ts_jest_1.createMock)();
        queryBusMock = (0, ts_jest_1.createMock)();
        mirrorNodeMock = (0, ts_jest_1.createMock)();
        handleValidationSpy = jest.spyOn(ValidatedArgs_1.default, "handleValidation");
        jest.spyOn(LogService_1.default, "logError").mockImplementation(() => { });
        Security_1.default.commandBus = commandBusMock;
        Security_1.default.queryBus = queryBusMock;
        Security_1.default.mirrorNode = mirrorNodeMock;
    });
    afterEach(() => {
        jest.resetAllMocks();
        jest.restoreAllMocks();
    });
    describe("transfer", () => {
        transferRequest = new request_1.TransferRequest(TransferFixture_1.TransferRequestFixture.create());
        const expectedResponse = {
            payload: true,
            transactionId: transactionId,
        };
        it("should transfer successfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.transfer(transferRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("TransferRequest", transferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new TransferCommand_1.TransferCommand(transferRequest.amount, transferRequest.targetId, transferRequest.securityId));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.transfer(transferRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("TransferRequest", transferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new TransferCommand_1.TransferCommand(transferRequest.amount, transferRequest.targetId, transferRequest.securityId));
        });
        it("should throw error if securityId is invalid", async () => {
            transferRequest = new request_1.TransferRequest({
                ...TransferFixture_1.TransferRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.transfer(transferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if targetId is invalid", async () => {
            transferRequest = new request_1.TransferRequest({
                ...TransferFixture_1.TransferRequestFixture.create({
                    targetId: "invalid",
                }),
            });
            await expect(Security_1.default.transfer(transferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amount is invalid", async () => {
            transferRequest = new request_1.TransferRequest({
                ...TransferFixture_1.TransferRequestFixture.create({
                    amount: "invalid",
                }),
            });
            await expect(Security_1.default.transfer(transferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
    describe("transferAndLock", () => {
        transferAndLockRequest = new request_1.TransferAndLockRequest(TransferFixture_1.TransferAndLockRequestFixture.create());
        const expectedResponse = {
            payload: true,
            transactionId: transactionId,
        };
        it("should transfer and lock successfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.transferAndLock(transferAndLockRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("TransferAndLockRequest", transferAndLockRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new TransferAndLockCommand_1.TransferAndLockCommand(transferAndLockRequest.amount, transferAndLockRequest.targetId, transferAndLockRequest.securityId, transferAndLockRequest.expirationDate));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.transferAndLock(transferAndLockRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("TransferAndLockRequest", transferAndLockRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new TransferAndLockCommand_1.TransferAndLockCommand(transferAndLockRequest.amount, transferAndLockRequest.targetId, transferAndLockRequest.securityId, transferAndLockRequest.expirationDate));
        });
        it("should throw error if securityId is invalid", async () => {
            transferAndLockRequest = new request_1.TransferAndLockRequest({
                ...TransferFixture_1.TransferAndLockRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.transferAndLock(transferAndLockRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if targetId is invalid", async () => {
            transferAndLockRequest = new request_1.TransferAndLockRequest({
                ...TransferFixture_1.TransferAndLockRequestFixture.create({
                    targetId: "invalid",
                }),
            });
            await expect(Security_1.default.transferAndLock(transferAndLockRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amount is invalid", async () => {
            transferAndLockRequest = new request_1.TransferAndLockRequest({
                ...TransferFixture_1.TransferAndLockRequestFixture.create({
                    amount: "invalid",
                }),
            });
            await expect(Security_1.default.transferAndLock(transferAndLockRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
    describe("controllerTransfer", () => {
        forceTransferRequest = new request_1.ForceTransferRequest(TransferFixture_1.ForceTransferRequestFixture.create());
        const expectedResponse = {
            payload: true,
            transactionId: transactionId,
        };
        it("should controller transfer successfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.controllerTransfer(forceTransferRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("ForceTransferRequest", forceTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new ControllerTransferCommand_1.ControllerTransferCommand(forceTransferRequest.amount, forceTransferRequest.sourceId, forceTransferRequest.targetId, forceTransferRequest.securityId));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.controllerTransfer(forceTransferRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("ForceTransferRequest", forceTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new ControllerTransferCommand_1.ControllerTransferCommand(forceTransferRequest.amount, forceTransferRequest.sourceId, forceTransferRequest.targetId, forceTransferRequest.securityId));
        });
        it("should throw error if securityId is invalid", async () => {
            forceTransferRequest = new request_1.ForceTransferRequest({
                ...TransferFixture_1.ForceTransferRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.controllerTransfer(forceTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if targetId is invalid", async () => {
            forceTransferRequest = new request_1.ForceTransferRequest({
                ...TransferFixture_1.ForceTransferRequestFixture.create({
                    targetId: "invalid",
                }),
            });
            await expect(Security_1.default.controllerTransfer(forceTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if sourceId is invalid", async () => {
            forceTransferRequest = new request_1.ForceTransferRequest({
                ...TransferFixture_1.ForceTransferRequestFixture.create({
                    sourceId: "invalid",
                }),
            });
            await expect(Security_1.default.controllerTransfer(forceTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amount is invalid", async () => {
            forceTransferRequest = new request_1.ForceTransferRequest({
                ...TransferFixture_1.ForceTransferRequestFixture.create({
                    amount: "invalid",
                }),
            });
            await expect(Security_1.default.controllerTransfer(forceTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
    describe("forcedTransfer", () => {
        forcedTransferRequest = new request_1.ForcedTransferRequest(TransferFixture_1.ForcedTransferRequestFixture.create());
        const expectedResponse = {
            payload: true,
            transactionId: transactionId,
        };
        it("should forced transfer successfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.forcedTransfer(forcedTransferRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("ForcedTransferRequest", forcedTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new ForcedTransferCommand_1.ForcedTransferCommand(forcedTransferRequest.sourceId, forcedTransferRequest.targetId, forcedTransferRequest.amount, forcedTransferRequest.securityId));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.forcedTransfer(forcedTransferRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("ForcedTransferRequest", forcedTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new ControllerTransferCommand_1.ControllerTransferCommand(forcedTransferRequest.amount, forcedTransferRequest.sourceId, forcedTransferRequest.targetId, forcedTransferRequest.securityId));
        });
        it("should throw error if securityId is invalid", async () => {
            forcedTransferRequest = new request_1.ForcedTransferRequest({
                ...TransferFixture_1.ForcedTransferRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.forcedTransfer(forcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if targetId is invalid", async () => {
            forcedTransferRequest = new request_1.ForceTransferRequest({
                ...TransferFixture_1.ForcedTransferRequestFixture.create({
                    targetId: "invalid",
                }),
            });
            await expect(Security_1.default.forcedTransfer(forcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if sourceId is invalid", async () => {
            forcedTransferRequest = new request_1.ForcedTransferRequest({
                ...TransferFixture_1.ForcedTransferRequestFixture.create({
                    sourceId: "invalid",
                }),
            });
            await expect(Security_1.default.forcedTransfer(forcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amount is invalid", async () => {
            forcedTransferRequest = new request_1.ForcedTransferRequest({
                ...TransferFixture_1.ForcedTransferRequestFixture.create({
                    amount: "invalid",
                }),
            });
            await expect(Security_1.default.forcedTransfer(forcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
    describe("protectedTransferFromByPartition", () => {
        protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest(ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create());
        const expectedResponse = {
            payload: true,
            transactionId: transactionId,
        };
        it("should protected transfer from by partition successfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("ProtectedTransferFromByPartitionRequest", protectedTransferFromByPartitionRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new ProtectedTransferFromByPartitionCommand_1.ProtectedTransferFromByPartitionCommand(protectedTransferFromByPartitionRequest.securityId, protectedTransferFromByPartitionRequest.partitionId, protectedTransferFromByPartitionRequest.sourceId, protectedTransferFromByPartitionRequest.targetId, protectedTransferFromByPartitionRequest.amount, protectedTransferFromByPartitionRequest.deadline, protectedTransferFromByPartitionRequest.nounce, protectedTransferFromByPartitionRequest.signature));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("ProtectedTransferFromByPartitionRequest", protectedTransferFromByPartitionRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new ProtectedTransferFromByPartitionCommand_1.ProtectedTransferFromByPartitionCommand(protectedTransferFromByPartitionRequest.securityId, protectedTransferFromByPartitionRequest.partitionId, protectedTransferFromByPartitionRequest.sourceId, protectedTransferFromByPartitionRequest.targetId, protectedTransferFromByPartitionRequest.amount, protectedTransferFromByPartitionRequest.deadline, protectedTransferFromByPartitionRequest.nounce, protectedTransferFromByPartitionRequest.signature));
        });
        it("should throw error if securityId is invalid", async () => {
            protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest({
                ...ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if partitionId is invalid", async () => {
            protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest({
                ...ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create({
                    partitionId: "invalid",
                }),
            });
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if sourceId is invalid", async () => {
            protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest({
                ...ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create({
                    sourceId: "invalid",
                }),
            });
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if targetId is invalid", async () => {
            protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest({
                ...ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create({
                    targetId: "invalid",
                }),
            });
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amount is invalid", async () => {
            protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest({
                ...ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create({
                    amount: "invalid",
                }),
            });
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if deadline is invalid", async () => {
            protectedTransferFromByPartitionRequest = new request_1.ProtectedTransferFromByPartitionRequest({
                ...ProtectedPartitionsFixture_1.ProtectedTransferFromByPartitionRequestFixture.create({
                    deadline: (Math.ceil(new Date().getTime() / 1000) - 100).toString(),
                }),
            });
            await expect(Security_1.default.protectedTransferFromByPartition(protectedTransferFromByPartitionRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
    describe("BatchTransfer", () => {
        batchTransferRequest = new request_1.BatchTransferRequest(BatchFixture_1.BatchTransferRequestFixture.create());
        const expectedResponse = new BatchTransferCommand_1.BatchTransferResponse(true, transactionId);
        it("should batch transfer sucessfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.batchTransfer(batchTransferRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("BatchTransferRequest", batchTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new BatchTransferCommand_1.BatchTransferCommand(batchTransferRequest.securityId, batchTransferRequest.amountList, batchTransferRequest.toList));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.batchTransfer(batchTransferRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("BatchTransferRequest", batchTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new BatchTransferCommand_1.BatchTransferCommand(batchTransferRequest.securityId, batchTransferRequest.amountList, batchTransferRequest.toList));
        });
        it("should throw error if securityId is invalid", async () => {
            batchTransferRequest = new request_1.BatchTransferRequest({
                ...BatchFixture_1.BatchTransferRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.batchTransfer(batchTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amountList is empty", async () => {
            batchTransferRequest = new request_1.BatchTransferRequest({
                ...BatchFixture_1.BatchTransferRequestFixture.create({
                    amountList: [],
                }),
            });
            await expect(Security_1.default.batchTransfer(batchTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if toList is empty", async () => {
            batchTransferRequest = new request_1.BatchTransferRequest({
                ...BatchFixture_1.BatchTransferRequestFixture.create({
                    toList: [],
                }),
            });
            await expect(Security_1.default.batchTransfer(batchTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if list lengths are not equal", async () => {
            batchTransferRequest = new request_1.BatchTransferRequest({
                ...BatchFixture_1.BatchTransferRequestFixture.create({
                    toList: [DataFixture_1.HederaIdPropsFixture.create().value, DataFixture_1.HederaIdPropsFixture.create().value],
                }),
            });
            await expect(Security_1.default.batchTransfer(batchTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
    describe("BatchForcedTransfer", () => {
        batchForcedTransferRequest = new request_1.BatchForcedTransferRequest(BatchFixture_1.BatchForcedTransferRequestFixture.create());
        const expectedResponse = new BatchForcedTransferCommand_1.BatchForcedTransferResponse(true, transactionId);
        it("should batch forced transfer sucessfully", async () => {
            commandBusMock.execute.mockResolvedValue(expectedResponse);
            const result = await Security_1.default.batchForcedTransfer(batchForcedTransferRequest);
            expect(handleValidationSpy).toHaveBeenCalledWith("BatchForcedTransferRequest", batchForcedTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new BatchForcedTransferCommand_1.BatchForcedTransferCommand(batchForcedTransferRequest.securityId, batchForcedTransferRequest.amountList, batchForcedTransferRequest.fromList, batchForcedTransferRequest.toList));
            expect(result).toEqual(expectedResponse);
        });
        it("should throw an error if command execution fails", async () => {
            const error = new Error("Command execution failed");
            commandBusMock.execute.mockRejectedValue(error);
            await expect(Security_1.default.batchForcedTransfer(batchForcedTransferRequest)).rejects.toThrow("Command execution failed");
            expect(handleValidationSpy).toHaveBeenCalledWith("BatchForcedTransferRequest", batchForcedTransferRequest);
            expect(commandBusMock.execute).toHaveBeenCalledWith(new BatchForcedTransferCommand_1.BatchForcedTransferCommand(batchForcedTransferRequest.securityId, batchForcedTransferRequest.amountList, batchForcedTransferRequest.fromList, batchForcedTransferRequest.toList));
        });
        it("should throw error if securityId is invalid", async () => {
            batchForcedTransferRequest = new request_1.BatchForcedTransferRequest({
                ...BatchFixture_1.BatchForcedTransferRequestFixture.create({
                    securityId: "invalid",
                }),
            });
            await expect(Security_1.default.batchForcedTransfer(batchForcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if amountList is empty", async () => {
            batchForcedTransferRequest = new request_1.BatchForcedTransferRequest({
                ...BatchFixture_1.BatchForcedTransferRequestFixture.create({
                    amountList: [],
                }),
            });
            await expect(Security_1.default.batchForcedTransfer(batchForcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if toList is empty", async () => {
            batchForcedTransferRequest = new request_1.BatchForcedTransferRequest({
                ...BatchFixture_1.BatchForcedTransferRequestFixture.create({
                    toList: [],
                }),
            });
            await expect(Security_1.default.batchForcedTransfer(batchForcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if fromList is empty", async () => {
            batchForcedTransferRequest = new request_1.BatchForcedTransferRequest({
                ...BatchFixture_1.BatchForcedTransferRequestFixture.create({
                    fromList: [],
                }),
            });
            await expect(Security_1.default.batchForcedTransfer(batchForcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
        it("should throw error if list lengths are not equal", async () => {
            batchForcedTransferRequest = new request_1.BatchForcedTransferRequest({
                ...BatchFixture_1.BatchForcedTransferRequestFixture.create({
                    toList: [DataFixture_1.HederaIdPropsFixture.create().value, DataFixture_1.HederaIdPropsFixture.create().value],
                }),
            });
            await expect(Security_1.default.batchForcedTransfer(batchForcedTransferRequest)).rejects.toThrow(ValidationError_1.ValidationError);
        });
    });
});
