UNPKG

@confluentinc/schemaregistry

Version:
31 lines (30 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const globals_1 = require("@jest/globals"); const encrypt_executor_1 = require("../../../rules/encryption/encrypt-executor"); (0, globals_1.describe)('FieldEncryptionExecutor', () => { (0, globals_1.it)('configure error', () => { const executor = new encrypt_executor_1.FieldEncryptionExecutor(); const clientConfig = { baseURLs: ['mock://'], cacheCapacity: 1000 }; const config = new Map(); config.set('key', 'value'); executor.configure(clientConfig, config); // configure with same args is fine executor.configure(clientConfig, config); const config2 = new Map(); config2.set('key2', 'value2'); // configure with additional config keys is fine executor.configure(clientConfig, config); const clientConfig2 = { baseURLs: ['blah://'], cacheCapacity: 1000 }; (0, globals_1.expect)(() => executor.configure(clientConfig2, config)).toThrowError(); const config3 = new Map(); config3.set('key', 'value3'); (0, globals_1.expect)(() => executor.configure(clientConfig, config3)).toThrowError(); }); });