mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
# Backport This will backport the following commits from `main` to `8.18`: - [[Siem Migrations] `GET /integrations` integration Test (#213251)](https://github.com/elastic/kibana/pull/213251) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2025-03-06T11:19:28Z","message":"[Siem Migrations] `GET /integrations` integration Test (#213251)\n\n## Summary\n\nAdds a smoke test for `GET /integrations` endpoint.\n\nHandles\n\n- https://github.com/elastic/security-team/issues/11232","sha":"60a9ac4f45b042884268387e5c34288e175057db","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Siem Migrations] `GET /integrations` integration Test","number":213251,"url":"https://github.com/elastic/kibana/pull/213251","mergeCommit":{"message":"[Siem Migrations] `GET /integrations` integration Test (#213251)\n\n## Summary\n\nAdds a smoke test for `GET /integrations` endpoint.\n\nHandles\n\n- https://github.com/elastic/security-team/issues/11232","sha":"60a9ac4f45b042884268387e5c34288e175057db"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213251","number":213251,"mergeCommit":{"message":"[Siem Migrations] `GET /integrations` integration Test (#213251)\n\n## Summary\n\nAdds a smoke test for `GET /integrations` endpoint.\n\nHandles\n\n- https://github.com/elastic/security-team/issues/11232","sha":"60a9ac4f45b042884268387e5c34288e175057db"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
This commit is contained in:
parent
a0fb6bf17f
commit
4ecc213db9
3 changed files with 47 additions and 0 deletions
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* 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; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../../../ftr_provider_context';
|
||||
import { migrationRulesRouteHelpersFactory } from '../../utils';
|
||||
|
||||
export default ({ getService }: FtrProviderContext) => {
|
||||
const supertest = getService('supertest');
|
||||
const migrationRulesRoutes = migrationRulesRouteHelpersFactory(supertest);
|
||||
|
||||
describe('Get Integrations', () => {
|
||||
it('should return all integrations successfully', async () => {
|
||||
const response = await migrationRulesRoutes.getIntegrations({});
|
||||
|
||||
const integrationsObj = response.body;
|
||||
const integrationIds = Object.keys(integrationsObj);
|
||||
|
||||
expect(integrationIds.length).to.be.greaterThan(0);
|
||||
expect(integrationsObj[integrationIds[0]]).to.have.keys('package', 'version');
|
||||
});
|
||||
});
|
||||
};
|
|
@ -16,5 +16,6 @@ export default function ({ loadTestFile }: FtrProviderContext) {
|
|||
loadTestFile(require.resolve('./update'));
|
||||
loadTestFile(require.resolve('./start'));
|
||||
loadTestFile(require.resolve('./stop'));
|
||||
loadTestFile(require.resolve('./get_integrations'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -22,10 +22,12 @@ import {
|
|||
SIEM_RULE_MIGRATION_STATS_PATH,
|
||||
SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH,
|
||||
SIEM_RULE_MIGRATION_STOP_PATH,
|
||||
SIEM_RULE_MIGRATIONS_INTEGRATIONS_PATH,
|
||||
} from '@kbn/security-solution-plugin/common/siem_migrations/constants';
|
||||
import {
|
||||
CreateRuleMigrationResponse,
|
||||
GetAllStatsRuleMigrationResponse,
|
||||
GetRuleMigrationIntegrationsResponse,
|
||||
GetRuleMigrationPrebuiltRulesResponse,
|
||||
GetRuleMigrationRequestQuery,
|
||||
GetRuleMigrationResponse,
|
||||
|
@ -262,5 +264,22 @@ export const migrationRulesRouteHelpersFactory = (supertest: SuperTest.Agent) =>
|
|||
|
||||
return response;
|
||||
},
|
||||
|
||||
getIntegrations: async ({
|
||||
expectStatusCode = 200,
|
||||
}: RequestParams): Promise<{
|
||||
body: GetRuleMigrationIntegrationsResponse;
|
||||
}> => {
|
||||
const response = await supertest
|
||||
.get(SIEM_RULE_MIGRATIONS_INTEGRATIONS_PATH)
|
||||
.set('kbn-xsrf', 'true')
|
||||
.set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.internal.v1)
|
||||
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
|
||||
.send();
|
||||
|
||||
assertStatusCode(expectStatusCode, response);
|
||||
|
||||
return response;
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue