Skip to content

Commit

Permalink
rename private functions in alerts as data client and add missing whi…
Browse files Browse the repository at this point in the history
…tespace char to inline snapshots
  • Loading branch information
dhurley14 committed Aug 9, 2021
1 parent ce41d56 commit c3ad00f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class AlertsClient {
* @param param0
* @returns
*/
private async fetchAlertAndAudit({
private async singleSearchAfterAndAduti({
id,
query,
index,
Expand Down Expand Up @@ -243,7 +243,7 @@ export class AlertsClient {
* @param param0
* @returns
*/
private async fetchAlertAuditOperate({
private async mgetAlertsAuditOperate({
ids,
status,
indexName,
Expand Down Expand Up @@ -291,7 +291,7 @@ export class AlertsClient {
});
return bulkUpdateResponse;
} catch (exc) {
this.logger.error(`error in fetchAlertAuditOperate ${exc}`);
this.logger.error(`error in mgetAlertsAuditOperate ${exc}`);
throw exc;
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ export class AlertsClient {

while (hasSortIds) {
try {
const result = await this.fetchAlertAndAudit({
const result = await this.singleSearchAfterAndAduti({
id: null,
query,
index,
Expand Down Expand Up @@ -401,7 +401,7 @@ export class AlertsClient {
public async get({ id, index }: GetAlertParams) {
try {
// first search for the alert by id, then use the alert info to check if user has access to it
const alert = await this.fetchAlertAndAudit({
const alert = await this.singleSearchAfterAndAduti({
id,
query: null,
index,
Expand Down Expand Up @@ -430,7 +430,7 @@ export class AlertsClient {
index,
}: UpdateOptions<Params>) {
try {
const alert = await this.fetchAlertAndAudit({
const alert = await this.singleSearchAfterAndAduti({
id,
query: null,
index,
Expand Down Expand Up @@ -474,7 +474,7 @@ export class AlertsClient {
}: BulkUpdateOptions<Params>) {
// rejects at the route level if more than 1000 id's are passed in
if (ids != null) {
return this.fetchAlertAuditOperate({
return this.mgetAlertsAuditOperate({
ids,
status,
indexName: index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ describe('bulkUpdate()', () => {
status: 'closed',
})
).rejects.toThrowErrorMatchingInlineSnapshot(`
"queryAndAuditAllAlerts threw an error: Unable to retrieve alerts with query \\"kibana.alert.status: open\\" and operation update
Error: Unable to retrieve alert details for alert with id of \\"null\\" or with query \\"kibana.alert.status: open\\" and operation update
"queryAndAuditAllAlerts threw an error: Unable to retrieve alerts with query \\"kibana.alert.status: open\\" and operation update
Error: Unable to retrieve alert details for alert with id of \\"null\\" or with query \\"kibana.alert.status: open\\" and operation update
Error: Error: Unauthorized for fake.rule and apm"
`);

Expand Down Expand Up @@ -417,8 +417,8 @@ describe('bulkUpdate()', () => {
status: 'closed',
})
).rejects.toThrowErrorMatchingInlineSnapshot(`
"queryAndAuditAllAlerts threw an error: Unable to retrieve alerts with query \\"kibana.alert.status: open\\" and operation update
Error: Unable to retrieve alert details for alert with id of \\"null\\" or with query \\"kibana.alert.status: open\\" and operation update
"queryAndAuditAllAlerts threw an error: Unable to retrieve alerts with query \\"kibana.alert.status: open\\" and operation update
Error: Unable to retrieve alert details for alert with id of \\"null\\" or with query \\"kibana.alert.status: open\\" and operation update
Error: Error: Unauthorized for fake.rule and apm"
`);

Expand Down

0 comments on commit c3ad00f

Please sign in to comment.