Skip to content

Commit

Permalink
Fix incorrect call to esClient.get(); use .kibana_cases index
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoldevila committed Apr 11, 2023
1 parent d1c1055 commit 6483764
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions x-pack/test/cases_api_integration/common/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { GetResponse } from '@elastic/elasticsearch/lib/api/types';

import type SuperTest from 'supertest';
import {
CASES_INDEX,
CASES_INTERNAL_URL,
CASES_URL,
CASE_CONFIGURE_URL,
Expand Down Expand Up @@ -43,7 +44,6 @@ import { ActionResult } from '@kbn/actions-plugin/server/types';
import { ESCasesConfigureAttributes } from '@kbn/cases-plugin/server/services/configure/types';
import { ESCaseAttributes } from '@kbn/cases-plugin/server/services/cases/types';
import type { SavedObjectsRawDocSource } from '@kbn/core/server';
import { SavedObjectsIndexPatterns } from '@kbn/core-saved-objects-server';
import { User } from '../authentication/types';
import { superUser } from '../authentication/users';
import { getSpaceUrlPrefix, setupAuth } from './helpers';
Expand Down Expand Up @@ -191,7 +191,7 @@ export const deleteAllCaseItems = async (es: Client) => {

export const deleteCasesUserActions = async (es: Client): Promise<void> => {
await es.deleteByQuery({
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
q: 'type:cases-user-actions',
wait_for_completion: true,
refresh: true,
Expand All @@ -202,7 +202,7 @@ export const deleteCasesUserActions = async (es: Client): Promise<void> => {

export const deleteCasesByESQuery = async (es: Client): Promise<void> => {
await es.deleteByQuery({
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
q: 'type:cases',
wait_for_completion: true,
refresh: true,
Expand All @@ -213,7 +213,7 @@ export const deleteCasesByESQuery = async (es: Client): Promise<void> => {

export const deleteComments = async (es: Client): Promise<void> => {
await es.deleteByQuery({
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
q: 'type:cases-comments',
wait_for_completion: true,
refresh: true,
Expand All @@ -224,7 +224,7 @@ export const deleteComments = async (es: Client): Promise<void> => {

export const deleteConfiguration = async (es: Client): Promise<void> => {
await es.deleteByQuery({
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
q: 'type:cases-configure',
wait_for_completion: true,
refresh: true,
Expand All @@ -235,7 +235,7 @@ export const deleteConfiguration = async (es: Client): Promise<void> => {

export const deleteMappings = async (es: Client): Promise<void> => {
await es.deleteByQuery({
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
q: 'type:cases-connector-mappings',
wait_for_completion: true,
refresh: true,
Expand Down Expand Up @@ -290,7 +290,7 @@ export const getConnectorMappingsFromES = async ({ es }: { es: Client }) => {
unknown
> = await es.search(
{
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
body: {
query: {
term: {
Expand Down Expand Up @@ -320,7 +320,7 @@ export const getConfigureSavedObjectsFromES = async ({ es }: { es: Client }) =>
unknown
> = await es.search(
{
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
body: {
query: {
term: {
Expand All @@ -343,7 +343,7 @@ export const getCaseSavedObjectsFromES = async ({ es }: { es: Client }) => {
unknown
> = await es.search(
{
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
body: {
query: {
term: {
Expand Down Expand Up @@ -725,7 +725,7 @@ export const getSOFromKibanaIndex = async ({
}) => {
const esResponse = await es.get<SavedObjectsRawDocSource>(
{
index: SavedObjectsIndexPatterns,
index: CASES_INDEX,
id: `${soType}:${soId}`,
},
{ meta: true }
Expand Down

0 comments on commit 6483764

Please sign in to comment.