Remove references to the actionsClient in our routes (#64966)
All of our actions management is happening via the triggers_actions_ui plugin, so this code is (and will be) unused. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
044f89ed14
commit
02bdb50c82
|
@ -11,12 +11,10 @@ import {
|
|||
savedObjectsClientMock,
|
||||
} from '../../../../../../../../src/core/server/mocks';
|
||||
import { alertsClientMock } from '../../../../../../alerting/server/mocks';
|
||||
import { actionsClientMock } from '../../../../../../actions/server/mocks';
|
||||
import { licensingMock } from '../../../../../../licensing/server/mocks';
|
||||
import { siemMock } from '../../../../mocks';
|
||||
|
||||
const createMockClients = () => ({
|
||||
actionsClient: actionsClientMock.create(),
|
||||
alertsClient: alertsClientMock.create(),
|
||||
clusterClient: elasticsearchServiceMock.createScopedClusterClient(),
|
||||
licensing: { license: licensingMock.createLicenseMock() },
|
||||
|
@ -29,7 +27,6 @@ const createRequestContextMock = (
|
|||
) => {
|
||||
const coreContext = coreMock.createRequestHandlerContext();
|
||||
return ({
|
||||
actions: { getActionsClient: jest.fn(() => clients.actionsClient) },
|
||||
alerting: { getAlertsClient: jest.fn(() => clients.alertsClient) },
|
||||
core: {
|
||||
...coreContext,
|
||||
|
|
|
@ -34,12 +34,11 @@ export const addPrepackedRulesRoute = (router: IRouter) => {
|
|||
|
||||
try {
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const clusterClient = context.core.elasticsearch.dataClient;
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
const siemClient = context.siem?.getSiemClient();
|
||||
|
||||
if (!siemClient || !actionsClient || !alertsClient) {
|
||||
if (!siemClient || !alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -62,16 +61,8 @@ export const addPrepackedRulesRoute = (router: IRouter) => {
|
|||
});
|
||||
}
|
||||
}
|
||||
await Promise.all(
|
||||
installPrepackagedRules(alertsClient, actionsClient, rulesToInstall, signalsIndex)
|
||||
);
|
||||
await updatePrepackagedRules(
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
rulesToUpdate,
|
||||
signalsIndex
|
||||
);
|
||||
await Promise.all(installPrepackagedRules(alertsClient, rulesToInstall, signalsIndex));
|
||||
await updatePrepackagedRules(alertsClient, savedObjectsClient, rulesToUpdate, signalsIndex);
|
||||
const prepackagedRulesOutput: PrePackagedRulesSchema = {
|
||||
rules_installed: rulesToInstall.length,
|
||||
rules_updated: rulesToUpdate.length,
|
||||
|
|
|
@ -39,12 +39,11 @@ export const createRulesBulkRoute = (router: IRouter) => {
|
|||
async (context, request, response) => {
|
||||
const siemResponse = buildSiemResponse(response);
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const clusterClient = context.core.elasticsearch.dataClient;
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
const siemClient = context.siem?.getSiemClient();
|
||||
|
||||
if (!siemClient || !actionsClient || !alertsClient) {
|
||||
if (!siemClient || !alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -113,7 +112,6 @@ export const createRulesBulkRoute = (router: IRouter) => {
|
|||
}
|
||||
const createdRule = await createRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
anomalyThreshold,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -72,12 +72,11 @@ export const createRulesRoute = (router: IRouter): void => {
|
|||
try {
|
||||
validateLicenseForRuleType({ license: context.licensing.license, ruleType: type });
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const clusterClient = context.core.elasticsearch.dataClient;
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
const siemClient = context.siem?.getSiemClient();
|
||||
|
||||
if (!siemClient || !actionsClient || !alertsClient) {
|
||||
if (!siemClient || !alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -100,7 +99,6 @@ export const createRulesRoute = (router: IRouter): void => {
|
|||
}
|
||||
const createdRule = await createRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
anomalyThreshold,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -34,10 +34,9 @@ export const deleteRulesBulkRoute = (router: IRouter) => {
|
|||
const siemResponse = buildSiemResponse(response);
|
||||
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
|
||||
if (!actionsClient || !alertsClient) {
|
||||
if (!alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -49,7 +48,6 @@ export const deleteRulesBulkRoute = (router: IRouter) => {
|
|||
const idOrRuleIdOrUnknown = id ?? ruleId ?? '(unknown id)';
|
||||
try {
|
||||
const rule = await deleteRules({
|
||||
actionsClient,
|
||||
alertsClient,
|
||||
id,
|
||||
ruleId,
|
||||
|
|
|
@ -34,16 +34,14 @@ export const deleteRulesRoute = (router: IRouter) => {
|
|||
const { id, rule_id: ruleId } = request.query;
|
||||
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
|
||||
if (!actionsClient || !alertsClient) {
|
||||
if (!alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
const ruleStatusClient = ruleStatusSavedObjectsClientFactory(savedObjectsClient);
|
||||
const rule = await deleteRules({
|
||||
actionsClient,
|
||||
alertsClient,
|
||||
id,
|
||||
ruleId,
|
||||
|
|
|
@ -60,7 +60,7 @@ describe('import_rules_route', () => {
|
|||
importRulesRoute(server.router, config);
|
||||
});
|
||||
|
||||
describe('status codes with actionsClient and alertClient', () => {
|
||||
describe('status codes', () => {
|
||||
test('returns 200 when importing a single rule with a valid actionClient and alertClient', async () => {
|
||||
const response = await server.inject(request, context);
|
||||
|
||||
|
@ -74,13 +74,6 @@ describe('import_rules_route', () => {
|
|||
expect(response.body).toEqual({ message: 'Not Found', status_code: 404 });
|
||||
});
|
||||
|
||||
test('returns 404 if actionsClient is not available on the route', async () => {
|
||||
context.actions!.getActionsClient = jest.fn();
|
||||
const response = await server.inject(request, context);
|
||||
expect(response.status).toEqual(404);
|
||||
expect(response.body).toEqual({ message: 'Not Found', status_code: 404 });
|
||||
});
|
||||
|
||||
it('returns 404 if siem client is unavailable', async () => {
|
||||
const { siem, ...contextWithoutSiem } = context;
|
||||
const response = await server.inject(request, contextWithoutSiem);
|
||||
|
|
|
@ -59,12 +59,11 @@ export const importRulesRoute = (router: IRouter, config: ConfigType) => {
|
|||
|
||||
try {
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const clusterClient = context.core.elasticsearch.dataClient;
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
const siemClient = context.siem?.getSiemClient();
|
||||
|
||||
if (!siemClient || !actionsClient || !alertsClient) {
|
||||
if (!siemClient || !alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -165,7 +164,6 @@ export const importRulesRoute = (router: IRouter, config: ConfigType) => {
|
|||
if (rule == null) {
|
||||
await createRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
anomalyThreshold,
|
||||
description,
|
||||
enabled,
|
||||
|
@ -202,7 +200,6 @@ export const importRulesRoute = (router: IRouter, config: ConfigType) => {
|
|||
} else if (rule != null && request.query.overwrite) {
|
||||
await patchRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -36,10 +36,9 @@ export const patchRulesBulkRoute = (router: IRouter) => {
|
|||
const siemResponse = buildSiemResponse(response);
|
||||
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
|
||||
if (!actionsClient || !alertsClient) {
|
||||
if (!alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -87,7 +86,6 @@ export const patchRulesBulkRoute = (router: IRouter) => {
|
|||
|
||||
const rule = await patchRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
description,
|
||||
enabled,
|
||||
falsePositives,
|
||||
|
|
|
@ -73,16 +73,14 @@ export const patchRulesRoute = (router: IRouter) => {
|
|||
}
|
||||
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
|
||||
if (!actionsClient || !alertsClient) {
|
||||
if (!alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
const ruleStatusClient = ruleStatusSavedObjectsClientFactory(savedObjectsClient);
|
||||
const rule = await patchRules({
|
||||
actionsClient,
|
||||
alertsClient,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -36,11 +36,10 @@ export const updateRulesBulkRoute = (router: IRouter) => {
|
|||
const siemResponse = buildSiemResponse(response);
|
||||
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
const siemClient = context.siem?.getSiemClient();
|
||||
|
||||
if (!siemClient || !actionsClient || !alertsClient) {
|
||||
if (!siemClient || !alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
|
@ -88,7 +87,6 @@ export const updateRulesBulkRoute = (router: IRouter) => {
|
|||
|
||||
const rule = await updateRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
anomalyThreshold,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -72,19 +72,17 @@ export const updateRulesRoute = (router: IRouter) => {
|
|||
validateLicenseForRuleType({ license: context.licensing.license, ruleType: type });
|
||||
|
||||
const alertsClient = context.alerting?.getAlertsClient();
|
||||
const actionsClient = context.actions?.getActionsClient();
|
||||
const savedObjectsClient = context.core.savedObjects.client;
|
||||
const siemClient = context.siem?.getSiemClient();
|
||||
const ruleStatusClient = ruleStatusSavedObjectsClientFactory(savedObjectsClient);
|
||||
|
||||
if (!siemClient || !actionsClient || !alertsClient) {
|
||||
if (!siemClient || !alertsClient) {
|
||||
return siemResponse.error({ statusCode: 404 });
|
||||
}
|
||||
|
||||
const finalIndex = outputIndex ?? siemClient.getSignalsIndex();
|
||||
const rule = await updateRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
anomalyThreshold,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -5,16 +5,13 @@
|
|||
*/
|
||||
|
||||
import { alertsClientMock } from '../../../../../alerting/server/mocks';
|
||||
import { actionsClientMock } from '../../../../../actions/server/mocks';
|
||||
import { getMlResult } from '../routes/__mocks__/request_responses';
|
||||
import { createRules } from './create_rules';
|
||||
|
||||
describe('createRules', () => {
|
||||
let actionsClient: ReturnType<typeof actionsClientMock.create>;
|
||||
let alertsClient: ReturnType<typeof alertsClientMock.create>;
|
||||
|
||||
beforeEach(() => {
|
||||
actionsClient = actionsClientMock.create();
|
||||
alertsClient = alertsClientMock.create();
|
||||
});
|
||||
|
||||
|
@ -27,7 +24,6 @@ describe('createRules', () => {
|
|||
|
||||
await createRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
...params,
|
||||
ruleId: 'new-rule-id',
|
||||
enabled: true,
|
||||
|
|
|
@ -4,20 +4,17 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { actionsClientMock } from '../../../../../actions/server/mocks';
|
||||
import { alertsClientMock } from '../../../../../alerting/server/mocks';
|
||||
import { deleteRules } from './delete_rules';
|
||||
import { readRules } from './read_rules';
|
||||
jest.mock('./read_rules');
|
||||
|
||||
describe('deleteRules', () => {
|
||||
let actionsClient: ReturnType<typeof actionsClientMock.create>;
|
||||
let alertsClient: ReturnType<typeof alertsClientMock.create>;
|
||||
const notificationId = 'notification-52128c15-0d1b-4716-a4c5-46997ac7f3bd';
|
||||
const ruleId = 'rule-04128c15-0d1b-4716-a4c5-46997ac7f3bd';
|
||||
|
||||
beforeEach(() => {
|
||||
actionsClient = actionsClientMock.create();
|
||||
alertsClient = alertsClientMock.create();
|
||||
});
|
||||
|
||||
|
@ -26,7 +23,6 @@ describe('deleteRules', () => {
|
|||
|
||||
const result = await deleteRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
id: notificationId,
|
||||
ruleId,
|
||||
});
|
||||
|
@ -41,7 +37,6 @@ describe('deleteRules', () => {
|
|||
|
||||
const result = await deleteRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
id: notificationId,
|
||||
ruleId,
|
||||
});
|
||||
|
@ -61,7 +56,6 @@ describe('deleteRules', () => {
|
|||
|
||||
const result = await deleteRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
id: notificationId,
|
||||
ruleId: null,
|
||||
});
|
||||
|
@ -87,7 +81,6 @@ describe('deleteRules', () => {
|
|||
|
||||
const result = await deleteRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
id: notificationId,
|
||||
ruleId: null,
|
||||
});
|
||||
|
@ -117,7 +110,6 @@ describe('deleteRules', () => {
|
|||
try {
|
||||
await deleteRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
id: notificationId,
|
||||
ruleId: null,
|
||||
});
|
||||
|
@ -140,7 +132,6 @@ describe('deleteRules', () => {
|
|||
|
||||
const result = await deleteRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
id: undefined,
|
||||
ruleId: null,
|
||||
});
|
||||
|
|
|
@ -7,12 +7,7 @@
|
|||
import { readRules } from './read_rules';
|
||||
import { DeleteRuleParams } from './types';
|
||||
|
||||
export const deleteRules = async ({
|
||||
alertsClient,
|
||||
actionsClient, // TODO: Use this when we have actions such as email, etc...
|
||||
id,
|
||||
ruleId,
|
||||
}: DeleteRuleParams) => {
|
||||
export const deleteRules = async ({ alertsClient, id, ruleId }: DeleteRuleParams) => {
|
||||
const rule = await readRules({ alertsClient, id, ruleId });
|
||||
if (rule == null) {
|
||||
return null;
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
*/
|
||||
|
||||
import { Alert } from '../../../../../alerting/common';
|
||||
import { ActionsClient } from '../../../../../actions/server';
|
||||
import { AlertsClient } from '../../../../../alerting/server';
|
||||
import { createRules } from './create_rules';
|
||||
import { PrepackagedRules } from '../types';
|
||||
|
||||
export const installPrepackagedRules = (
|
||||
alertsClient: AlertsClient,
|
||||
actionsClient: ActionsClient,
|
||||
rules: PrepackagedRules[],
|
||||
outputIndex: string
|
||||
): Array<Promise<Alert>> =>
|
||||
|
@ -52,7 +50,6 @@ export const installPrepackagedRules = (
|
|||
...acc,
|
||||
createRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
anomalyThreshold,
|
||||
description,
|
||||
enabled,
|
||||
|
|
|
@ -6,17 +6,14 @@
|
|||
|
||||
import { savedObjectsClientMock } from '../../../../../../../src/core/server/mocks';
|
||||
import { alertsClientMock } from '../../../../../alerting/server/mocks';
|
||||
import { actionsClientMock } from '../../../../../actions/server/mocks';
|
||||
import { getResult, getMlResult } from '../routes/__mocks__/request_responses';
|
||||
import { patchRules } from './patch_rules';
|
||||
|
||||
describe('patchRules', () => {
|
||||
let actionsClient: ReturnType<typeof actionsClientMock.create>;
|
||||
let alertsClient: ReturnType<typeof alertsClientMock.create>;
|
||||
let savedObjectsClient: ReturnType<typeof savedObjectsClientMock.create>;
|
||||
|
||||
beforeEach(() => {
|
||||
actionsClient = actionsClientMock.create();
|
||||
alertsClient = alertsClientMock.create();
|
||||
savedObjectsClient = savedObjectsClientMock.create();
|
||||
});
|
||||
|
@ -27,7 +24,6 @@ describe('patchRules', () => {
|
|||
|
||||
await patchRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
|
||||
...rule.params,
|
||||
|
@ -53,7 +49,6 @@ describe('patchRules', () => {
|
|||
|
||||
await patchRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
|
||||
...rule.params,
|
||||
|
@ -80,7 +75,6 @@ describe('patchRules', () => {
|
|||
|
||||
await patchRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
|
||||
...params,
|
||||
|
|
|
@ -14,7 +14,6 @@ import { ruleStatusSavedObjectsClientFactory } from '../signals/rule_status_save
|
|||
|
||||
export const patchRules = async ({
|
||||
alertsClient,
|
||||
actionsClient, // TODO: Use this whenever we add feature support for different action types
|
||||
savedObjectsClient,
|
||||
description,
|
||||
falsePositives,
|
||||
|
|
|
@ -16,7 +16,6 @@ import {
|
|||
import { AlertsClient, PartialAlert } from '../../../../../alerting/server';
|
||||
import { Alert } from '../../../../../alerting/common';
|
||||
import { SIGNALS_ID } from '../../../../common/constants';
|
||||
import { ActionsClient } from '../../../../../actions/server';
|
||||
import { RuleAlertParams, RuleTypeParams, RuleAlertParamsRest } from '../types';
|
||||
|
||||
export type PatchRuleAlertParamsRest = Partial<RuleAlertParamsRest> & {
|
||||
|
@ -139,7 +138,6 @@ export interface FindRulesStatusesRequestParams {
|
|||
|
||||
export interface Clients {
|
||||
alertsClient: AlertsClient;
|
||||
actionsClient: ActionsClient;
|
||||
}
|
||||
|
||||
export type PatchRuleParams = Partial<Omit<RuleAlertParams, 'throttle'>> & {
|
||||
|
|
|
@ -6,19 +6,16 @@
|
|||
|
||||
import { savedObjectsClientMock } from '../../../../../../../src/core/server/mocks';
|
||||
import { alertsClientMock } from '../../../../../alerting/server/mocks';
|
||||
import { actionsClientMock } from '../../../../../actions/server/mocks';
|
||||
import { mockPrepackagedRule } from '../routes/__mocks__/request_responses';
|
||||
import { updatePrepackagedRules } from './update_prepacked_rules';
|
||||
import { patchRules } from './patch_rules';
|
||||
jest.mock('./patch_rules');
|
||||
|
||||
describe('updatePrepackagedRules', () => {
|
||||
let actionsClient: ReturnType<typeof actionsClientMock.create>;
|
||||
let alertsClient: ReturnType<typeof alertsClientMock.create>;
|
||||
let savedObjectsClient: ReturnType<typeof savedObjectsClientMock.create>;
|
||||
|
||||
beforeEach(() => {
|
||||
actionsClient = actionsClientMock.create();
|
||||
alertsClient = alertsClientMock.create();
|
||||
savedObjectsClient = savedObjectsClientMock.create();
|
||||
});
|
||||
|
@ -37,7 +34,6 @@ describe('updatePrepackagedRules', () => {
|
|||
|
||||
await updatePrepackagedRules(
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
[{ ...prepackagedRule, actions }],
|
||||
outputIndex
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
*/
|
||||
|
||||
import { SavedObjectsClientContract } from 'kibana/server';
|
||||
import { ActionsClient } from '../../../../../actions/server';
|
||||
import { AlertsClient } from '../../../../../alerting/server';
|
||||
import { patchRules } from './patch_rules';
|
||||
import { PrepackagedRules } from '../types';
|
||||
|
||||
export const updatePrepackagedRules = async (
|
||||
alertsClient: AlertsClient,
|
||||
actionsClient: ActionsClient,
|
||||
savedObjectsClient: SavedObjectsClientContract,
|
||||
rules: PrepackagedRules[],
|
||||
outputIndex: string
|
||||
|
@ -48,7 +46,6 @@ export const updatePrepackagedRules = async (
|
|||
// or enable rules on the user when they were not expecting it if a rule updates
|
||||
return patchRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
description,
|
||||
falsePositives,
|
||||
from,
|
||||
|
|
|
@ -6,17 +6,14 @@
|
|||
|
||||
import { savedObjectsClientMock } from '../../../../../../../src/core/server/mocks';
|
||||
import { alertsClientMock } from '../../../../../alerting/server/mocks';
|
||||
import { actionsClientMock } from '../../../../../actions/server/mocks';
|
||||
import { getResult, getMlResult } from '../routes/__mocks__/request_responses';
|
||||
import { updateRules } from './update_rules';
|
||||
|
||||
describe('updateRules', () => {
|
||||
let actionsClient: ReturnType<typeof actionsClientMock.create>;
|
||||
let alertsClient: ReturnType<typeof alertsClientMock.create>;
|
||||
let savedObjectsClient: ReturnType<typeof savedObjectsClientMock.create>;
|
||||
|
||||
beforeEach(() => {
|
||||
actionsClient = actionsClientMock.create();
|
||||
alertsClient = alertsClientMock.create();
|
||||
savedObjectsClient = savedObjectsClientMock.create();
|
||||
});
|
||||
|
@ -27,7 +24,6 @@ describe('updateRules', () => {
|
|||
|
||||
await updateRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
|
||||
...rule.params,
|
||||
|
@ -54,7 +50,6 @@ describe('updateRules', () => {
|
|||
|
||||
await updateRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
|
||||
...rule.params,
|
||||
|
@ -83,7 +78,6 @@ describe('updateRules', () => {
|
|||
|
||||
await updateRules({
|
||||
alertsClient,
|
||||
actionsClient,
|
||||
savedObjectsClient,
|
||||
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
|
||||
...params,
|
||||
|
|
|
@ -15,7 +15,6 @@ import { ruleStatusSavedObjectsClientFactory } from '../signals/rule_status_save
|
|||
|
||||
export const updateRules = async ({
|
||||
alertsClient,
|
||||
actionsClient, // TODO: Use this whenever we add feature support for different action types
|
||||
savedObjectsClient,
|
||||
description,
|
||||
falsePositives,
|
||||
|
|
Loading…
Reference in a new issue