"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const uuid_1 = require("uuid");
require("jest-extended");
const cactus_common_1 = require("@hyperledger/cactus-common");
const public_api_1 = require("../../../../main/typescript/public-api");
const public_api_2 = require("../../../../main/typescript/public-api");
const testcase = "";
describe(testcase, () => {
    const configService = new public_api_2.ConfigService();
    let apiServer, exampleConfig, convictConfig, config;
    beforeAll(async () => {
        exampleConfig = await configService.newExampleConfig();
        const pluginsPath = path_1.default.join(__dirname, "../../../../../../", // walk back up to the project root
        ".tmp/test/test-cmd-api-server/config-service-example-config-validity_test/", // the dir path from the root
        (0, uuid_1.v4)());
        const pluginManagerOptionsJson = JSON.stringify({ pluginsPath });
        exampleConfig.pluginManagerOptionsJson = pluginManagerOptionsJson;
        // FIXME - this hack should not be necessary, we need to re-think how we
        // do configuration parsing. The convict library may not be the path forward.
        exampleConfig.authorizationConfigJson = JSON.stringify(exampleConfig.authorizationConfigJson);
        exampleConfig.configFile = "";
        exampleConfig.apiPort = 0;
        exampleConfig.cockpitPort = 0;
        convictConfig = await configService.newExampleConfigConvict(exampleConfig);
        config = convictConfig.getProperties();
        apiServer = new public_api_1.ApiServer({ config });
    });
    afterAll(() => apiServer.shutdown());
    test("Generates valid example config for the API server", async () => {
        expect(configService).toBeTruthy();
        expect(exampleConfig).toBeTruthy();
        expect(convictConfig).toBeTruthy();
        expect(config).toBeTruthy();
        cactus_common_1.LoggerProvider.setLogLevel(config.logLevel);
        await apiServer.start();
    });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLXNlcnZpY2UtZXhhbXBsZS1jb25maWctdmFsaWRpdHkudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy90ZXN0L3R5cGVzY3Jpc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