"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable jest/no-mocks-import */
const CommandBus_1 = require("../../src/core/command/CommandBus");
const ConcreteCommandHandler_1 = require("./__mocks__/ConcreteCommandHandler");
const commandBus = new CommandBus_1.CommandBus();
describe("CommandHandler Test", () => {
    it("Executes a simple command successfully", async () => {
        const execSpy = jest.spyOn(commandBus, "execute");
        const command = new ConcreteCommandHandler_1.ConcreteCommand("1", 4);
        const res = await commandBus.execute(command);
        expect(res).toBeInstanceOf(ConcreteCommandHandler_1.ConcreteCommandResponse);
        expect(res.payload).toBe(command.payload);
        expect(execSpy).toHaveBeenCalled();
    });
});
