Skip to content

Commit

Permalink
[IngestManager] fix endpoint setup in api integration tests (#69503) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Jun 18, 2020
1 parent d53e882 commit 3869d85
Showing 1 changed file with 4 additions and 7 deletions.
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);
}
},
};
}

0 comments on commit 3869d85

Please sign in to comment.