"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable jest/no-mocks-import */
const QueryBus_1 = require("../../src/core/query/QueryBus");
const ConcreteQueryHandler_1 = require("./__mocks__/ConcreteQueryHandler");
const queryBus = new QueryBus_1.QueryBus();
describe("QueryHandler Test", () => {
    it("Executes a simple query successfully", async () => {
        const execSpy = jest.spyOn(queryBus, "execute");
        const query = new ConcreteQueryHandler_1.ConcreteQuery("1", 4);
        const res = await queryBus.execute(query);
        expect(res).toBeInstanceOf(ConcreteQueryHandler_1.ConcreteQueryResponse);
        expect(res.payload).toBe(query.payload);
        expect(execSpy).toHaveBeenCalled();
    });
});
