kibana/test/plugin_functional/test_suites/core_plugins/elasticsearch_client.ts
Brandon Kobel 57af8462e4
[7.x] Elastic License 2.0 (#90192)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:39:13 -08:00

27 lines
1.2 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { PluginFunctionalProviderContext } from '../../services';
import '../../plugins/core_provider_plugin/types';
export default function ({ getService, getPageObjects }: PluginFunctionalProviderContext) {
const supertest = getService('supertest');
describe('elasticsearch client', () => {
it('server plugins have access to elasticsearch client via request context', async () => {
await supertest.get('/api/elasticsearch_client_plugin/context/ping').expect(200, 'true');
});
it('server plugins have access to elasticsearch client via core contract', async () => {
await supertest.get('/api/elasticsearch_client_plugin/contract/ping').expect(200, 'true');
});
it('server plugins can create a custom elasticsearch client', async () => {
await supertest
.get('/api/elasticsearch_client_plugin/custom_client/ping')
.expect(200, 'true');
});
});
}