diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx
index 324dcef8ba397..5a4fbbf615966 100644
--- a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx
+++ b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx
@@ -138,6 +138,25 @@ describe('ServiceNowITSM Fields', () => {
expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument();
});
+ it('does not show the deprecated callout when the connector is preconfigured', async () => {
+ render(
+
+ );
+ expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument();
+ });
+
+ it('does not show the deprecated callout when the config of the connector is undefined', async () => {
+ render(
+ // @ts-expect-error
+
+ );
+ expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument();
+ });
+
describe('onChange calls', () => {
const wrapper = mount();
diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx
index cd8f5f4abf7b5..c0cdd6d1505be 100644
--- a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx
+++ b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx
@@ -172,6 +172,25 @@ describe('ServiceNowSIR Fields', () => {
expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument();
});
+ it('does not show the deprecated callout when the connector is preconfigured', async () => {
+ render(
+
+ );
+ expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument();
+ });
+
+ it('does not show the deprecated callout when the config of the connector is undefined', async () => {
+ render(
+ // @ts-expect-error
+
+ );
+ expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument();
+ });
+
describe('onChange calls', () => {
const wrapper = mount();
diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts
index aa643191ac62e..ab21a6b5c779c 100644
--- a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts
+++ b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts
@@ -22,7 +22,7 @@ describe('ServiceNow validator', () => {
expect(connectorValidator(invalidConnector)).toEqual({ message: 'Deprecated connector' });
});
- test('it does not returns an error message if the connector does not uses the table API', () => {
+ test('it does not return an error message if the connector does not uses the table API', () => {
const invalidConnector = {
...connector,
config: {
@@ -33,5 +33,16 @@ describe('ServiceNow validator', () => {
expect(connectorValidator(invalidConnector)).toBeFalsy();
});
+
+ test('it does not return an error message if the config of the connector is undefined', () => {
+ const { config, ...invalidConnector } = connector;
+
+ // @ts-expect-error
+ expect(connectorValidator(invalidConnector)).toBeFalsy();
+ });
+
+ test('it does not return an error message if the config of the connector is preconfigured', () => {
+ expect(connectorValidator({ ...connector, isPreconfigured: true })).toBeFalsy();
+ });
});
});
diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts
index 7d56163c48350..fed2900715527 100644
--- a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts
+++ b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts
@@ -15,10 +15,18 @@ import { CaseActionConnector } from '../../types';
export const connectorValidator = (
connector: CaseActionConnector
): ReturnType => {
- const {
- config: { usesTableApi },
- } = connector;
- if (usesTableApi) {
+ /**
+ * It is not possible to know if a preconfigured connector
+ * is deprecated or not as the config property of a
+ * preconfigured connector is not returned by the
+ * actions framework
+ */
+
+ if (connector.isPreconfigured || connector.config == null) {
+ return;
+ }
+
+ if (connector.config?.usesTableApi) {
return {
message: 'Deprecated connector',
};
diff --git a/x-pack/plugins/cases/public/components/utils.test.ts b/x-pack/plugins/cases/public/components/utils.test.ts
index e3cc753e75746..ed8d37cf5120a 100644
--- a/x-pack/plugins/cases/public/components/utils.test.ts
+++ b/x-pack/plugins/cases/public/components/utils.test.ts
@@ -83,5 +83,16 @@ describe('Utils', () => {
})
).toBe(true);
});
+
+ it('returns false if the connector preconfigured', () => {
+ expect(isDeprecatedConnector({ ...connector, isPreconfigured: true })).toBe(false);
+ });
+
+ it('returns false if the config is undefined', () => {
+ expect(
+ // @ts-expect-error
+ isDeprecatedConnector({ ...connector, config: undefined })
+ ).toBe(false);
+ });
});
});
diff --git a/x-pack/plugins/cases/public/components/utils.ts b/x-pack/plugins/cases/public/components/utils.ts
index 82d2682e65fad..cc6a69146aa25 100644
--- a/x-pack/plugins/cases/public/components/utils.ts
+++ b/x-pack/plugins/cases/public/components/utils.ts
@@ -74,7 +74,13 @@ export const getConnectorIcon = (
// TODO: Remove when the applications are certified
export const isDeprecatedConnector = (connector?: CaseActionConnector): boolean => {
- if (connector == null) {
+ /**
+ * It is not possible to know if a preconfigured connector
+ * is deprecated or not as the config property of a
+ * preconfigured connector is not returned by the
+ * actions framework
+ */
+ if (connector == null || connector.config == null || connector.isPreconfigured) {
return false;
}
diff --git a/x-pack/plugins/cases/server/client/configure/client.test.ts b/x-pack/plugins/cases/server/client/configure/client.test.ts
index 971748bd8295a..8790695bbd416 100644
--- a/x-pack/plugins/cases/server/client/configure/client.test.ts
+++ b/x-pack/plugins/cases/server/client/configure/client.test.ts
@@ -9,7 +9,6 @@ import { CasesClientArgs } from '../types';
import { loggingSystemMock } from '../../../../../../src/core/server/mocks';
import { getConnectors } from './client';
import { actionsClientMock } from '../../../../actions/server/mocks';
-import { ActionType } from '../../../../actions/common/types';
describe('client', () => {
describe('getConnectors', () => {
@@ -18,66 +17,153 @@ describe('client', () => {
const args = { actionsClient, logger } as unknown as CasesClientArgs;
- const jiraType: ActionType = {
- id: '.jira',
- name: '1',
- enabled: true,
- enabledInConfig: true,
- enabledInLicense: true,
- minimumLicenseRequired: 'basic',
- };
+ const actionTypes = [
+ {
+ id: '.jira',
+ name: '1',
+ enabled: true,
+ enabledInConfig: true,
+ enabledInLicense: true,
+ minimumLicenseRequired: 'basic' as const,
+ },
+ {
+ id: '.servicenow',
+ name: '2',
+ enabled: true,
+ enabledInConfig: true,
+ enabledInLicense: true,
+ minimumLicenseRequired: 'basic' as const,
+ },
+ {
+ id: '.unsupported',
+ name: '3',
+ enabled: true,
+ enabledInConfig: true,
+ enabledInLicense: true,
+ minimumLicenseRequired: 'basic' as const,
+ },
+ {
+ id: '.swimlane',
+ name: 'swimlane',
+ enabled: true,
+ enabledInConfig: true,
+ enabledInLicense: false,
+ minimumLicenseRequired: 'basic' as const,
+ },
+ ];
+
+ const connectors = [
+ {
+ id: '1',
+ actionTypeId: '.jira',
+ name: '1',
+ config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
+ },
+ {
+ id: '2',
+ actionTypeId: '.servicenow',
+ name: '2',
+ config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
+ },
+ {
+ id: '3',
+ actionTypeId: '.unsupported',
+ name: '3',
+ config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
+ },
+ ];
beforeEach(() => {
jest.clearAllMocks();
});
- it('removes connectors without a config field defined', async () => {
- actionsClient.listTypes.mockImplementation(async () => [jiraType]);
+ it('remove unsupported connectors', async () => {
+ actionsClient.listTypes.mockImplementation(async () => actionTypes);
+ actionsClient.getAll.mockImplementation(async () => connectors);
- actionsClient.getAll.mockImplementation(async () => [
+ expect(await getConnectors(args)).toEqual([
{
id: '1',
actionTypeId: '.jira',
name: '1',
+ config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
+ },
+ {
+ id: '2',
+ actionTypeId: '.servicenow',
+ name: '2',
+ config: {},
isPreconfigured: false,
referencedByCount: 1,
},
]);
-
- expect(await getConnectors(args)).toEqual([]);
});
- it('removes connectors that are pre configured', async () => {
- actionsClient.listTypes.mockImplementation(async () => [jiraType]);
-
+ it('returns preconfigured connectors', async () => {
+ actionsClient.listTypes.mockImplementation(async () => actionTypes);
actionsClient.getAll.mockImplementation(async () => [
+ ...connectors,
+ {
+ id: '4',
+ actionTypeId: '.servicenow',
+ name: 'sn-preconfigured',
+ config: {},
+ isPreconfigured: true,
+ referencedByCount: 1,
+ },
+ ]);
+
+ expect(await getConnectors(args)).toEqual([
{
id: '1',
actionTypeId: '.jira',
name: '1',
config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
+ },
+ {
+ id: '2',
+ actionTypeId: '.servicenow',
+ name: '2',
+ config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
+ },
+ {
+ id: '4',
+ actionTypeId: '.servicenow',
+ name: 'sn-preconfigured',
+ config: {},
isPreconfigured: true,
referencedByCount: 1,
},
]);
-
- expect(await getConnectors(args)).toEqual([]);
});
- it('includes connectors that have a config and are not pre configured', async () => {
- actionsClient.listTypes.mockImplementation(async () => [
- jiraType,
+ it('filter out connectors that are unsupported by the current license', async () => {
+ actionsClient.listTypes.mockImplementation(async () => actionTypes);
+ actionsClient.getAll.mockImplementation(async () => [
+ ...connectors,
{
- id: '.servicenow',
- name: '2',
- enabled: true,
- enabledInConfig: true,
- enabledInLicense: true,
- minimumLicenseRequired: 'basic',
+ id: '4',
+ actionTypeId: '.swimlane',
+ name: 'swimlane',
+ config: {},
+ isPreconfigured: false,
+ referencedByCount: 1,
},
]);
- const connectors = [
+ expect(await getConnectors(args)).toEqual([
{
id: '1',
actionTypeId: '.jira',
@@ -94,11 +180,7 @@ describe('client', () => {
isPreconfigured: false,
referencedByCount: 1,
},
- ];
-
- actionsClient.getAll.mockImplementation(async () => connectors);
-
- expect(await getConnectors(args)).toEqual(connectors);
+ ]);
});
});
});
diff --git a/x-pack/plugins/cases/server/client/configure/client.ts b/x-pack/plugins/cases/server/client/configure/client.ts
index 4136dc4680bbc..647967eaaaba6 100644
--- a/x-pack/plugins/cases/server/client/configure/client.ts
+++ b/x-pack/plugins/cases/server/client/configure/client.ts
@@ -228,9 +228,7 @@ function isConnectorSupported(
): boolean {
return (
SUPPORTED_CONNECTORS.includes(action.actionTypeId) &&
- actionTypes[action.actionTypeId]?.enabledInLicense &&
- action.config != null &&
- !action.isPreconfigured
+ actionTypes[action.actionTypeId]?.enabledInLicense
);
}
diff --git a/x-pack/test/case_api_integration/common/config.ts b/x-pack/test/case_api_integration/common/config.ts
index 32bd089a39e72..4d46422732fc8 100644
--- a/x-pack/test/case_api_integration/common/config.ts
+++ b/x-pack/test/case_api_integration/common/config.ts
@@ -142,6 +142,19 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
(pluginDir) =>
`--plugin-path=${path.resolve(__dirname, 'fixtures', 'plugins', pluginDir)}`
),
+ `--xpack.actions.preconfigured=${JSON.stringify({
+ 'preconfigured-servicenow': {
+ name: 'preconfigured-servicenow',
+ actionTypeId: '.servicenow',
+ config: {
+ apiUrl: 'https://example.com',
+ },
+ secrets: {
+ username: 'elastic',
+ password: 'elastic',
+ },
+ },
+ })}`,
`--server.xsrf.whitelist=${JSON.stringify(getAllExternalServiceSimulatorPaths())}`,
...(ssl
? [
diff --git a/x-pack/test/case_api_integration/common/lib/utils.ts b/x-pack/test/case_api_integration/common/lib/utils.ts
index 9d48aed32d55c..9785c78cfe091 100644
--- a/x-pack/test/case_api_integration/common/lib/utils.ts
+++ b/x-pack/test/case_api_integration/common/lib/utils.ts
@@ -405,6 +405,19 @@ export const getWebhookConnector = () => ({
},
});
+export const getEmailConnector = () => ({
+ name: 'An email action',
+ connector_type_id: '.email',
+ config: {
+ service: '__json',
+ from: 'bob@example.com',
+ },
+ secrets: {
+ user: 'bob',
+ password: 'supersecret',
+ },
+});
+
interface CommonSavedObjectAttributes {
id?: string | null;
created_at?: string | null;
diff --git a/x-pack/test/case_api_integration/security_and_spaces/tests/basic/configure/create_connector.ts b/x-pack/test/case_api_integration/security_and_spaces/tests/basic/configure/create_connector.ts
deleted file mode 100644
index fe8e311b5e4f6..0000000000000
--- a/x-pack/test/case_api_integration/security_and_spaces/tests/basic/configure/create_connector.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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 { createConnector, getServiceNowConnector } from '../../../../common/lib/utils';
-import { FtrProviderContext } from '../../../../common/ftr_provider_context';
-
-// eslint-disable-next-line import/no-default-export
-export default function serviceNow({ getService }: FtrProviderContext) {
- const supertest = getService('supertest');
-
- describe('create service now action', () => {
- it('should return 403 when creating a service now action', async () => {
- await createConnector({ supertest, req: getServiceNowConnector(), expectedHttpCode: 403 });
- });
- });
-}
diff --git a/x-pack/test/case_api_integration/security_and_spaces/tests/common/configure/get_connectors.ts b/x-pack/test/case_api_integration/security_and_spaces/tests/basic/configure/get_connectors.ts
similarity index 64%
rename from x-pack/test/case_api_integration/security_and_spaces/tests/common/configure/get_connectors.ts
rename to x-pack/test/case_api_integration/security_and_spaces/tests/basic/configure/get_connectors.ts
index 46f712ff84aa3..57854075c20fb 100644
--- a/x-pack/test/case_api_integration/security_and_spaces/tests/common/configure/get_connectors.ts
+++ b/x-pack/test/case_api_integration/security_and_spaces/tests/basic/configure/get_connectors.ts
@@ -15,13 +15,18 @@ export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
describe('get_connectors', () => {
- it('should return an empty find body correctly if no connectors are loaded', async () => {
+ /**
+ * A ServiceNow preconfigured connector is registered here
+ * x-pack/test/cases_api_integration/common/config.ts
+ *
+ * The license for this test is set to basic. ServiceNow connectors
+ * needs license >= platinum. The test below ensures
+ * that connectors without valid license are being filtered correctly
+ */
+ it('should return an empty list of connectors', async () => {
const connectors = await getCaseConnectors({ supertest });
- expect(connectors).to.eql([]);
- });
- it.skip('filters out connectors that are not enabled in license', async () => {
- // TODO: Should find a way to downgrade license to gold and upgrade back to trial
+ expect(connectors).to.eql([]);
});
});
};
diff --git a/x-pack/test/case_api_integration/security_and_spaces/tests/basic/index.ts b/x-pack/test/case_api_integration/security_and_spaces/tests/basic/index.ts
index ce2f59a115e69..b618cf5b4df68 100644
--- a/x-pack/test/case_api_integration/security_and_spaces/tests/basic/index.ts
+++ b/x-pack/test/case_api_integration/security_and_spaces/tests/basic/index.ts
@@ -24,6 +24,7 @@ export default ({ loadTestFile, getService }: FtrProviderContext): void => {
// Basic
loadTestFile(require.resolve('./cases/push_case'));
+ loadTestFile(require.resolve('./configure/get_connectors'));
// Common
loadTestFile(require.resolve('../common'));
diff --git a/x-pack/test/case_api_integration/security_and_spaces/tests/common/index.ts b/x-pack/test/case_api_integration/security_and_spaces/tests/common/index.ts
index 0b933582d84a5..1d08f85a3d13a 100644
--- a/x-pack/test/case_api_integration/security_and_spaces/tests/common/index.ts
+++ b/x-pack/test/case_api_integration/security_and_spaces/tests/common/index.ts
@@ -31,7 +31,6 @@ export default ({ loadTestFile }: FtrProviderContext): void => {
loadTestFile(require.resolve('./cases/tags/get_tags'));
loadTestFile(require.resolve('./user_actions/get_all_user_actions'));
loadTestFile(require.resolve('./configure/get_configure'));
- loadTestFile(require.resolve('./configure/get_connectors'));
loadTestFile(require.resolve('./configure/patch_configure'));
loadTestFile(require.resolve('./configure/post_configure'));
loadTestFile(require.resolve('./connectors/case'));
diff --git a/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts b/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts
index a4e69ab928325..91309462d98be 100644
--- a/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts
+++ b/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts
@@ -8,7 +8,6 @@
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
-import { CASE_CONFIGURE_CONNECTORS_URL } from '../../../../../../plugins/cases/common/constants';
import { ObjectRemover as ActionsRemover } from '../../../../../alerting_api_integration/common/lib';
import {
getServiceNowConnector,
@@ -16,6 +15,8 @@ import {
getResilientConnector,
createConnector,
getServiceNowSIRConnector,
+ getEmailConnector,
+ getCaseConnectors,
} from '../../../../common/lib/utils';
// eslint-disable-next-line import/no-default-export
@@ -29,41 +30,10 @@ export default ({ getService }: FtrProviderContext): void => {
});
it('should return the correct connectors', async () => {
- const { body: snConnector } = await supertest
- .post('/api/actions/connector')
- .set('kbn-xsrf', 'true')
- .send(getServiceNowConnector())
- .expect(200);
-
- const { body: emailConnector } = await supertest
- .post('/api/actions/connector')
- .set('kbn-xsrf', 'true')
- .send({
- name: 'An email action',
- connector_type_id: '.email',
- config: {
- service: '__json',
- from: 'bob@example.com',
- },
- secrets: {
- user: 'bob',
- password: 'supersecret',
- },
- })
- .expect(200);
-
- const { body: jiraConnector } = await supertest
- .post('/api/actions/connector')
- .set('kbn-xsrf', 'true')
- .send(getJiraConnector())
- .expect(200);
-
- const { body: resilientConnector } = await supertest
- .post('/api/actions/connector')
- .set('kbn-xsrf', 'true')
- .send(getResilientConnector())
- .expect(200);
-
+ const snConnector = await createConnector({ supertest, req: getServiceNowConnector() });
+ const emailConnector = await createConnector({ supertest, req: getEmailConnector() });
+ const jiraConnector = await createConnector({ supertest, req: getJiraConnector() });
+ const resilientConnector = await createConnector({ supertest, req: getResilientConnector() });
const sir = await createConnector({ supertest, req: getServiceNowSIRConnector() });
actionsRemover.add('default', sir.id, 'action', 'actions');
@@ -72,11 +42,7 @@ export default ({ getService }: FtrProviderContext): void => {
actionsRemover.add('default', jiraConnector.id, 'action', 'actions');
actionsRemover.add('default', resilientConnector.id, 'action', 'actions');
- const { body: connectors } = await supertest
- .get(`${CASE_CONFIGURE_CONNECTORS_URL}/_find`)
- .set('kbn-xsrf', 'true')
- .send()
- .expect(200);
+ const connectors = await getCaseConnectors({ supertest });
expect(connectors).to.eql([
{
@@ -91,6 +57,17 @@ export default ({ getService }: FtrProviderContext): void => {
isMissingSecrets: false,
referencedByCount: 0,
},
+ /**
+ * Preconfigured connectors are being registered here:
+ * x-pack/test/cases_api_integration/common/config.ts
+ */
+ {
+ actionTypeId: '.servicenow',
+ id: 'preconfigured-servicenow',
+ isPreconfigured: true,
+ name: 'preconfigured-servicenow',
+ referencedByCount: 0,
+ },
{
id: resilientConnector.id,
actionTypeId: '.resilient',
diff --git a/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts b/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts
index 02b91c9f0b918..d91e48cff559b 100644
--- a/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts
+++ b/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts
@@ -18,6 +18,7 @@ import {
getAuthWithSuperUser,
getCaseConnectors,
getActionsSpace,
+ getEmailConnector,
} from '../../../../common/lib/utils';
// eslint-disable-next-line import/no-default-export
@@ -38,32 +39,25 @@ export default ({ getService }: FtrProviderContext): void => {
req: getServiceNowConnector(),
auth: authSpace1,
});
+
const emailConnector = await createConnector({
supertest,
- req: {
- name: 'An email action',
- connector_type_id: '.email',
- config: {
- service: '__json',
- from: 'bob@example.com',
- },
- secrets: {
- user: 'bob',
- password: 'supersecret',
- },
- },
+ req: getEmailConnector(),
auth: authSpace1,
});
+
const jiraConnector = await createConnector({
supertest,
req: getJiraConnector(),
auth: authSpace1,
});
+
const resilientConnector = await createConnector({
supertest,
req: getResilientConnector(),
auth: authSpace1,
});
+
const sir = await createConnector({
supertest,
req: getServiceNowSIRConnector(),
@@ -91,6 +85,17 @@ export default ({ getService }: FtrProviderContext): void => {
isMissingSecrets: false,
referencedByCount: 0,
},
+ /**
+ * Preconfigured connectors are being registered here:
+ * x-pack/test/cases_api_integration/common/config.ts
+ */
+ {
+ actionTypeId: '.servicenow',
+ id: 'preconfigured-servicenow',
+ isPreconfigured: true,
+ name: 'preconfigured-servicenow',
+ referencedByCount: 0,
+ },
{
id: resilientConnector.id,
actionTypeId: '.resilient',
@@ -136,32 +141,25 @@ export default ({ getService }: FtrProviderContext): void => {
req: getServiceNowConnector(),
auth: authSpace1,
});
+
const emailConnector = await createConnector({
supertest,
- req: {
- name: 'An email action',
- connector_type_id: '.email',
- config: {
- service: '__json',
- from: 'bob@example.com',
- },
- secrets: {
- user: 'bob',
- password: 'supersecret',
- },
- },
+ req: getEmailConnector(),
auth: authSpace1,
});
+
const jiraConnector = await createConnector({
supertest,
req: getJiraConnector(),
auth: authSpace1,
});
+
const resilientConnector = await createConnector({
supertest,
req: getResilientConnector(),
auth: authSpace1,
});
+
const sir = await createConnector({
supertest,
req: getServiceNowSIRConnector(),
@@ -179,7 +177,19 @@ export default ({ getService }: FtrProviderContext): void => {
auth: getAuthWithSuperUser('space2'),
});
- expect(connectors).to.eql([]);
+ expect(connectors).to.eql([
+ /**
+ * Preconfigured connectors are being registered here:
+ * x-pack/test/cases_api_integration/common/config.ts
+ */
+ {
+ actionTypeId: '.servicenow',
+ id: 'preconfigured-servicenow',
+ isPreconfigured: true,
+ name: 'preconfigured-servicenow',
+ referencedByCount: 0,
+ },
+ ]);
});
});
};