Skip to content

Commit

Permalink
[Discover] replace searchSourceUtils with searchSourceClient in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaanj committed May 15, 2022
1 parent 63df64c commit 7ab49d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { castArray, omit } from 'lodash';
import { RuleDataClient } from '../rule_data_client';
import { createRuleDataClientMock } from '../rule_data_client/rule_data_client.mock';
import { createLifecycleRuleTypeFactory } from './create_lifecycle_rule_type_factory';
import { ISearchStartSearchSource } from '@kbn/data-plugin/common';

type RuleTestHelpers = ReturnType<typeof createRule>;

Expand Down Expand Up @@ -117,10 +118,7 @@ function createRule(shouldWriteAlerts: boolean = true) {
shouldWriteAlerts: () => shouldWriteAlerts,
shouldStopExecution: () => false,
search: {} as any,
searchSourceUtils: {
searchSourceClient: {},
wrappedFetch: () => {},
} as any,
searchSourceClient: {} as ISearchStartSearchSource,
},
spaceId: 'spaceId',
state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import {
RuleTypeState,
} from '@kbn/alerting-plugin/server';
import { alertsMock } from '@kbn/alerting-plugin/server/mocks';
import {
searchSourceCommonMock,
searchSourceInstanceMock,
} from '@kbn/data-plugin/common/search/search_source/mocks';
import { searchSourceCommonMock } from '@kbn/data-plugin/common/search/search_source/mocks';

export const createDefaultAlertExecutorOptions = <
Params extends RuleTypeParams = never,
Expand Down Expand Up @@ -79,10 +76,7 @@ export const createDefaultAlertExecutorOptions = <
scopedClusterClient: elasticsearchServiceMock.createScopedClusterClient(),
shouldWriteAlerts: () => shouldWriteAlerts,
shouldStopExecution: () => false,
searchSourceUtils: {
searchSourceClient: searchSourceCommonMock,
wrappedFetch: () => searchSourceInstanceMock.fetch(),
},
searchSourceClient: searchSourceCommonMock,
},
state,
updatedBy: null,
Expand Down

0 comments on commit 7ab49d7

Please sign in to comment.