Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IngestManager] fix endpoint setup in api integration tests #69503

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions x-pack/test/api_integration/services/ingest_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { FtrProviderContext } from '../ftr_provider_context';
import { setupRouteService, fleetSetupRouteService } from '../../../plugins/ingest_manager/common';
import { fleetSetupRouteService } from '../../../plugins/ingest_manager/common';

export function IngestManagerProvider({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
return {
async setup() {
const headers = { accept: 'application/json', 'kbn-xsrf': 'some-xsrf-token' };

const { body } = await supertest
.get(fleetSetupRouteService.getFleetSetupPath())
await supertest
.post(fleetSetupRouteService.postFleetSetupPath())
.set(headers)
.send({ forceRecreate: true })
.expect(200);

if (!body.isInitialized) {
await supertest.post(setupRouteService.getSetupPath()).set(headers).expect(200);
}
},
};
}