Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import { ConfigType } from '../../../../config';
import { AlertAttributes } from '../../signals/types';
import { createRuleMock } from './rule';
import { listMock } from '../../../../../../lists/server/mocks';
import { RuleParams } from '../../schemas/rule_schemas';
import { QueryRuleParams, RuleParams } from '../../schemas/rule_schemas';
// this is only used in tests
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { createDefaultAlertExecutorOptions } from '../../../../../../rule_registry/server/utils/rule_executor_test_utils';
import { getCompleteRuleMock } from '../../schemas/rule_schemas.mock';

export const createRuleTypeMocks = (
ruleType: string = 'query',
Expand Down Expand Up @@ -88,9 +89,15 @@ export const createRuleTypeMocks = (
lists: listMock.createSetup(),
logger: loggerMock,
ml: mlPluginServerMock.createSetupContract(),
ruleDataClient: ruleRegistryMocks.createRuleDataClient(
'.alerts-security.alerts'
) as IRuleDataClient,
ruleDataClient: {
...(ruleRegistryMocks.createRuleDataClient('.alerts-security.alerts') as IRuleDataClient),
getReader: jest.fn((_options?: { namespace?: string }) => ({
search: jest.fn().mockResolvedValue({
aggregations: undefined,
}),
getDynamicIndexPattern: jest.fn(),
})),
},
eventLogService: eventLogServiceMock.create(),
},
services,
Expand All @@ -102,6 +109,9 @@ export const createRuleTypeMocks = (
alertId: v4(),
state: {},
}),
runOpts: {
completeRule: getCompleteRuleMock(params as QueryRuleParams),
},
services,
});
},
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { CreateRuleOptions, SecurityAlertType } from '../types';
export const createIndicatorMatchAlertType = (
createOptions: CreateRuleOptions
): SecurityAlertType<ThreatRuleParams, {}, {}, 'default'> => {
const { experimentalFeatures, logger, version } = createOptions;
const { eventsTelemetry, experimentalFeatures, logger, version } = createOptions;
return {
id: INDICATOR_RULE_TYPE_ID,
name: 'Indicator Match Rule',
Expand Down Expand Up @@ -68,7 +68,7 @@ export const createIndicatorMatchAlertType = (
bulkCreate,
exceptionItems,
experimentalFeatures,
eventsTelemetry: undefined,
eventsTelemetry,
listClient,
logger,
completeRule,
Expand Down

This file was deleted.

Loading