Skip to content

Commit

Permalink
PR feedback pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Jun 17, 2019
1 parent bf2ab81 commit 39187c0
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const mockTaskManager = taskManagerMock.create();
function getServices() {
return {
log: jest.fn(),
callCluster: jest.fn(),
callClusterWithInternalUser: jest.fn(),
savedObjectsClient: SavedObjectsClientMock.create(),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const mockEncryptedSavedObjectsPlugin = {
function getServices() {
return {
log: jest.fn(),
callCluster: jest.fn(),
callClusterWithInternalUser: jest.fn(),
savedObjectsClient: SavedObjectsClientMock.create(),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getCreateTaskRunnerFunctionParams = {
getServices() {
return {
log: jest.fn(),
callCluster: jest.fn(),
callClusterWithInternalUser: jest.fn(),
savedObjectsClient: SavedObjectsClientMock.create(),
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const NO_OP_FN = () => {};

const services = {
log: NO_OP_FN,
callCluster: NO_OP_FN,
callClusterWithInternalUser: NO_OP_FN,
savedObjectsClient: SavedObjectsClientMock.create(),
};

Expand Down Expand Up @@ -119,7 +119,7 @@ describe('execute()', () => {
await actionType.executor({
services: {
log: mockLog,
callCluster: NO_OP_FN,
callClusterWithInternalUser: NO_OP_FN,
savedObjectsClient: SavedObjectsClientMock.create(),
},
config: {},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function init(server: Legacy.Server) {
};
return {
log: server.log,
callCluster: callWithInternalUser,
callClusterWithInternalUser: callWithInternalUser,
savedObjectsClient: server.savedObjects.getScopedSavedObjectsClient(fakeRequest),
};
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface SavedObjectReference {
}

export interface Services {
callCluster: any;
callClusterWithInternalUser: any;
savedObjectsClient: SavedObjectsClientContract;
log: (tags: string | string[], data?: string | object | (() => any), timestamp?: number) => void;
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/alert_type_registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const alertTypeRegistryParams = {
getServices() {
return {
log: jest.fn(),
callCluster: jest.fn(),
callClusterWithInternalUser: jest.fn(),
savedObjectsClient: SavedObjectsClientMock.create(),
};
},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function init(server: Legacy.Server) {
};
return {
log: server.log,
callCluster: callWithInternalUser,
callClusterWithInternalUser: callWithInternalUser,
savedObjectsClient: server.savedObjects.getScopedSavedObjectsClient(fakeRequest),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getCreateTaskRunnerFunctionParams = {
getServices() {
return {
log: jest.fn(),
callCluster: jest.fn(),
callClusterWithInternalUser: jest.fn(),
savedObjectsClient: SavedObjectsClientMock.create(),
};
},
Expand Down Expand Up @@ -103,7 +103,7 @@ Object {
expect(call.scheduledRunAt).toMatchInlineSnapshot(`2019-06-03T18:55:20.982Z`);
expect(call.state).toMatchInlineSnapshot(`Object {}`);
expect(call.services.alertInstanceFactory).toBeTruthy();
expect(call.services.callCluster).toBeTruthy();
expect(call.services.callClusterWithInternalUser).toBeTruthy();
expect(call.services).toBeTruthy();
});

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type Log = (

export interface Services {
log: Log;
callCluster: any;
callClusterWithInternalUser: any;
savedObjectsClient: SavedObjectsClientContract;
}

Expand Down

0 comments on commit 39187c0

Please sign in to comment.