diff --git a/x-pack/plugins/monitoring/server/lib/details/get_metrics.test.js b/x-pack/plugins/monitoring/server/lib/details/get_metrics.test.js index 5ba7fd1207448a..3f643cf0be27ae 100644 --- a/x-pack/plugins/monitoring/server/lib/details/get_metrics.test.js +++ b/x-pack/plugins/monitoring/server/lib/details/get_metrics.test.js @@ -29,17 +29,9 @@ jest.mock('../../static_globals', () => ({ })); function getMockReq(metricsBuckets = []) { - const config = { - get: sinon.stub(), - }; - - config.get.withArgs('monitoring.ui.min_interval_seconds').returns(10); - return { server: { - config() { - return config; - }, + config: { ui: { min_interval_seconds: 10 } }, plugins: { elasticsearch: { getCluster: sinon diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.test.js index f96cb8e7a18539..3dc2c6c75b79f1 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.test.js @@ -42,9 +42,7 @@ jest.mock('../../../details/get_metrics', () => ({ describe('getPaginatedNodes', () => { const req = { server: { - config: () => ({ - get: () => 10, - }), + config: { ui: { max_bucket_size: 10000 } }, }, }; const clusterUuid = '1abc'; diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.test.js index 6a9e01166ea875..f273117b867ad1 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.test.js @@ -30,9 +30,7 @@ describe('getIndicesUnassignedShardStats', () => { const req = { payload: {}, server: { - config: () => ({ - get: () => {}, - }), + config: { ui: { max_bucket_size: 10000 } }, plugins: { elasticsearch: { getCluster: () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.test.js index c5c77ef389427c..04e50f16be6dea 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.test.js @@ -30,9 +30,7 @@ describe('getNodeShardCount', () => { const req = { payload: {}, server: { - config: () => ({ - get: () => {}, - }), + config: { ui: { max_bucket_size: 10000 } }, plugins: { elasticsearch: { getCluster: () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_nodes.test.ts b/x-pack/plugins/monitoring/server/lib/logstash/get_nodes.test.ts index 24e3a849214642..3483d9be5d4a86 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_nodes.test.ts +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_nodes.test.ts @@ -23,19 +23,12 @@ jest.mock('../../static_globals', () => ({ describe('getNodes', () => { it('ensures collapse key is present query responses', async () => { - const configs: { [key: string]: number } = { 'monitoring.ui.max_bucket_size': 10000 }; - const config = { - get: jest.fn().mockImplementation((key: string) => configs[key]), - }; - const response = {}; const callWithRequest = jest.fn().mockResolvedValue(response); const req = { server: { - config() { - return config; - }, + config: { ui: { max_bucket_size: 10000 } }, plugins: { elasticsearch: { getCluster: () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.js b/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.js index bbcedf7fdd33d2..214e8d5907443d 100644 --- a/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.js +++ b/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.js @@ -17,6 +17,7 @@ const mockReq = ( ) => { return { server: { + instanceUuid: 'kibana-1234', newPlatform: { setup: { plugins: { @@ -28,15 +29,7 @@ const mockReq = ( }, }, }, - config() { - return { - get: jest.fn((prop) => { - if (prop === 'server.uuid') { - return 'kibana-1234'; - } - }), - }; - }, + config: { ui: { ccs: { enabled: false } } }, usage: { collectorSet: { getCollectorByType: () => ({