diff --git a/test/api_integration/apis/data_views/fields_for_wildcard_route/response.ts b/test/api_integration/apis/data_views/fields_for_wildcard_route/response.ts index 5b3c033dfe67f..7c33001c3f91e 100644 --- a/test/api_integration/apis/data_views/fields_for_wildcard_route/response.ts +++ b/test/api_integration/apis/data_views/fields_for_wildcard_route/response.ts @@ -6,6 +6,8 @@ * Side Public License, v 1. */ +import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import { INITIAL_REST_VERSION_INTERNAL } from '@kbn/data-views-plugin/server/constants'; import expect from '@kbn/expect'; import { sortBy } from 'lodash'; import { FtrProviderContext } from '../../../ftr_provider_context'; @@ -83,6 +85,7 @@ export default function ({ getService }: FtrProviderContext) { it('returns a flattened version of the fields in es', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') + .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL) .query({ pattern: 'basic_index' }) .expect(200, { fields: testFields, @@ -94,6 +97,7 @@ export default function ({ getService }: FtrProviderContext) { it('returns a single field as requested', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') + .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL) .query({ pattern: 'basic_index', fields: JSON.stringify(['bar']) }) .expect(200, { fields: [testFields[0]], @@ -104,6 +108,7 @@ export default function ({ getService }: FtrProviderContext) { it('always returns a field for all passed meta fields', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') + .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL) .query({ pattern: 'basic_index', meta_fields: JSON.stringify(['_id', '_source', 'crazy_meta_field']), @@ -196,6 +201,7 @@ export default function ({ getService }: FtrProviderContext) { it('returns fields when one pattern exists and the other does not', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') + .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL) .query({ pattern: 'bad_index,basic_index' }) .expect(200, { fields: testFields, @@ -206,6 +212,7 @@ export default function ({ getService }: FtrProviderContext) { it('returns 404 when neither exists', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') + .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL) .query({ pattern: 'bad_index,bad_index_2' }) .expect(404); }); @@ -213,6 +220,7 @@ export default function ({ getService }: FtrProviderContext) { it('returns 404 when no patterns exist', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') + .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL) .query({ pattern: 'bad_index', })