Skip to content

Commit

Permalink
[SIEM][CASE] Moves functional tests from "legacyEs" to "Es" (elastic#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed May 8, 2020
1 parent f897841 commit 158d5d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
// eslint-disable-next-line import/no-default-export
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
const es = getService('legacyEs');
const es = getService('es');

describe('get_configure', () => {
afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
// eslint-disable-next-line import/no-default-export
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
const es = getService('legacyEs');
const es = getService('es');

describe('post_configure', () => {
afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
// eslint-disable-next-line import/no-default-export
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
const es = getService('legacyEs');
const es = getService('es');

describe('post_configure', () => {
afterEach(async () => {
Expand Down
7 changes: 4 additions & 3 deletions x-pack/test/case_api_integration/common/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Client } from '@elastic/elasticsearch';
import { CasesConfigureRequest, CasesConfigureResponse } from '../../../../plugins/case/common/api';

export const getConfiguration = (connector_id: string = 'connector-1'): CasesConfigureRequest => {
Expand All @@ -29,12 +30,12 @@ export const removeServerGeneratedPropertiesFromConfigure = (
return rest;
};

export const deleteConfiguration = async (es: any): Promise<void> => {
export const deleteConfiguration = async (es: Client): Promise<void> => {
await es.deleteByQuery({
index: '.kibana',
q: 'type:cases-configure',
waitForCompletion: true,
refresh: 'wait_for',
wait_for_completion: true,
refresh: true,
body: {},
});
};
Expand Down

0 comments on commit 158d5d1

Please sign in to comment.