Skip to content

Commit e949598

Browse files
committed
Fix integration tests
1 parent 5f6a93e commit e949598

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

x-pack/platform/plugins/shared/alerting_v2/server/lib/dispatcher/integration_tests/dispatcher.test.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import type { TestElasticsearchUtils, TestKibanaUtils } from '@kbn/core-test-hel
99
import type { ElasticsearchClient } from '@kbn/core/server';
1010
import { ALERT_ACTIONS_DATA_STREAM } from '../../../resources/alert_actions';
1111
import { ALERT_EVENTS_DATA_STREAM } from '../../../resources/alert_events';
12-
import { createMockLoggerService } from '../../services/logger_service/logger_service.mock';
12+
import type { LoggerServiceContract } from '../../services/logger_service/logger_service';
13+
import { createLoggerService } from '../../services/logger_service/logger_service.mock';
1314
import {
1415
StorageService,
1516
type StorageServiceContract,
@@ -83,7 +84,7 @@ describe('DispatcherService integration tests', () => {
8384
let esClient: ElasticsearchClient;
8485
let dispatcherService: DispatcherServiceContract;
8586
let storageService: StorageServiceContract;
86-
let mockLoggerService: ReturnType<typeof createMockLoggerService>;
87+
let mockLoggerService: LoggerServiceContract;
8788

8889
beforeAll(async () => {
8990
const servers = await setupTestServers();
@@ -106,13 +107,10 @@ describe('DispatcherService integration tests', () => {
106107
beforeEach(async () => {
107108
await cleanupDataStreams(esClient);
108109

109-
mockLoggerService = createMockLoggerService();
110-
storageService = new StorageService(esClient, mockLoggerService.loggerService);
111-
dispatcherService = new DispatcherService(
112-
esClient,
113-
mockLoggerService.loggerService,
114-
storageService
115-
);
110+
mockLoggerService = createLoggerService().loggerService;
111+
112+
storageService = new StorageService(esClient, mockLoggerService);
113+
dispatcherService = new DispatcherService(esClient, mockLoggerService, storageService);
116114
});
117115

118116
describe('when there are no alert events', () => {

x-pack/platform/plugins/shared/alerting_v2/server/resources/alert_actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const alertActionSchema = z.object({
4747
group_hash: z.string(),
4848
last_series_event_timestamp: z.string(),
4949
expiry: z.string().optional(),
50-
actor: z.string(),
50+
actor: z.string().nullable(),
5151
action_type: z.string(), // "fire-event"
5252
episode_id: z.string().optional(),
5353
rule_id: z.string(),

0 commit comments

Comments
 (0)