From 38d2e74fe8ea2dd00d589035fbae96793b8c568b Mon Sep 17 00:00:00 2001 From: kobelb Date: Fri, 7 Sep 2018 08:44:53 -0400 Subject: [PATCH] Removing the "saved_objects" folder --- x-pack/scripts/functional_tests.js | 4 ++- .../suites/{saved_objects => }/bulk_get.ts | 6 ++--- .../suites/{saved_objects => }/create.ts | 6 ++--- .../suites/{saved_objects => }/delete.ts | 6 ++--- .../common/suites/{saved_objects => }/find.ts | 6 ++--- .../common/suites/{saved_objects => }/get.ts | 6 ++--- .../suites/{saved_objects => }/update.ts | 6 ++--- .../apis/{saved_objects => }/bulk_get.ts | 8 +++--- .../apis/{saved_objects => }/create.ts | 8 +++--- .../apis/{saved_objects => }/delete.ts | 8 +++--- .../apis/{saved_objects => }/find.ts | 8 +++--- .../apis/{saved_objects => }/get.ts | 8 +++--- .../security_and_spaces/apis/index.ts | 12 ++++++--- .../apis/saved_objects/index.ts | 19 -------------- .../apis/{saved_objects => }/update.ts | 8 +++--- .../apis/{saved_objects => }/bulk_get.ts | 6 ++--- .../apis/{saved_objects => }/create.ts | 6 ++--- .../apis/{saved_objects => }/delete.ts | 6 ++--- .../apis/{saved_objects => }/find.ts | 6 ++--- .../apis/{saved_objects => }/get.ts | 6 ++--- .../security_only/apis/index.ts | 12 ++++++--- .../security_only/apis/saved_objects/index.ts | 25 ------------------- .../apis/{saved_objects => }/update.ts | 6 ++--- .../apis/{saved_objects => }/bulk_get.ts | 6 ++--- .../apis/{saved_objects => }/create.ts | 6 ++--- .../apis/{saved_objects => }/delete.ts | 6 ++--- .../apis/{saved_objects => }/find.ts | 6 ++--- .../apis/{saved_objects => }/get.ts | 6 ++--- .../spaces_only/apis/index.ts | 25 ++++++++++++------- .../spaces_only/apis/saved_objects/index.ts | 25 ------------------- .../apis/{saved_objects => }/update.ts | 6 ++--- 31 files changed, 115 insertions(+), 163 deletions(-) rename x-pack/test/saved_object_api_integration/common/suites/{saved_objects => }/bulk_get.ts (94%) rename x-pack/test/saved_object_api_integration/common/suites/{saved_objects => }/create.ts (95%) rename x-pack/test/saved_object_api_integration/common/suites/{saved_objects => }/delete.ts (94%) rename x-pack/test/saved_object_api_integration/common/suites/{saved_objects => }/find.ts (96%) rename x-pack/test/saved_object_api_integration/common/suites/{saved_objects => }/get.ts (94%) rename x-pack/test/saved_object_api_integration/common/suites/{saved_objects => }/update.ts (95%) rename x-pack/test/saved_object_api_integration/security_and_spaces/apis/{saved_objects => }/bulk_get.ts (95%) rename x-pack/test/saved_object_api_integration/security_and_spaces/apis/{saved_objects => }/create.ts (96%) rename x-pack/test/saved_object_api_integration/security_and_spaces/apis/{saved_objects => }/delete.ts (97%) rename x-pack/test/saved_object_api_integration/security_and_spaces/apis/{saved_objects => }/find.ts (98%) rename x-pack/test/saved_object_api_integration/security_and_spaces/apis/{saved_objects => }/get.ts (96%) delete mode 100644 x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts rename x-pack/test/saved_object_api_integration/security_and_spaces/apis/{saved_objects => }/update.ts (97%) rename x-pack/test/saved_object_api_integration/security_only/apis/{saved_objects => }/bulk_get.ts (96%) rename x-pack/test/saved_object_api_integration/security_only/apis/{saved_objects => }/create.ts (97%) rename x-pack/test/saved_object_api_integration/security_only/apis/{saved_objects => }/delete.ts (97%) rename x-pack/test/saved_object_api_integration/security_only/apis/{saved_objects => }/find.ts (98%) rename x-pack/test/saved_object_api_integration/security_only/apis/{saved_objects => }/get.ts (97%) delete mode 100644 x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts rename x-pack/test/saved_object_api_integration/security_only/apis/{saved_objects => }/update.ts (97%) rename x-pack/test/saved_object_api_integration/spaces_only/apis/{saved_objects => }/bulk_get.ts (85%) rename x-pack/test/saved_object_api_integration/spaces_only/apis/{saved_objects => }/create.ts (87%) rename x-pack/test/saved_object_api_integration/spaces_only/apis/{saved_objects => }/delete.ts (88%) rename x-pack/test/saved_object_api_integration/spaces_only/apis/{saved_objects => }/find.ts (92%) rename x-pack/test/saved_object_api_integration/spaces_only/apis/{saved_objects => }/get.ts (87%) delete mode 100644 x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts rename x-pack/test/saved_object_api_integration/spaces_only/apis/{saved_objects => }/update.ts (88%) diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index 33abe151b7d29..c2fa6b051637a 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -13,7 +13,9 @@ require('@kbn/test').runTestsCli([ require.resolve('../test/functional/config.js'), require.resolve('../test/api_integration/config.js'), require.resolve('../test/saml_api_integration/config.js'), - require.resolve('../test/rbac_api_integration/config.js'), require.resolve('../test/spaces_api_integration/spaces_only/config.js'), require.resolve('../test/spaces_api_integration/security_and_spaces/config.js'), + require.resolve('../test/saved_object_api_integration/security_and_spaces/config'), + require.resolve('../test/saved_object_api_integration/security_only/config'), + require.resolve('../test/saved_object_api_integration/spaces_only/config'), ]); diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts similarity index 94% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts index ab62907cb897c..5b65722d7b0b2 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts @@ -5,9 +5,9 @@ */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { getIdPrefix, getUrlPrefix } from '../../../common/lib/space_test_utils'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface BulkGetTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/common/suites/create.ts similarity index 95% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/common/suites/create.ts index 38b3592098b45..e6ffee7d75add 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/create.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; -import { getUrlPrefix } from '../../lib/space_test_utils'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface CreateTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/common/suites/delete.ts similarity index 94% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/common/suites/delete.ts index 3f54b4238399b..26f2b903bb014 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/delete.ts @@ -5,9 +5,9 @@ */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; -import { getIdPrefix, getUrlPrefix } from '../../lib/space_test_utils'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface DeleteTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/common/suites/find.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/common/suites/find.ts index 554b5fc4928d4..9b1f6e82ab430 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/find.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { getIdPrefix, getUrlPrefix } from '../../../common/lib/space_test_utils'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface FindTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/common/suites/get.ts similarity index 94% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/common/suites/get.ts index 7164fdfbc7f16..f6526dcf5a949 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; -import { getIdPrefix, getUrlPrefix } from '../../lib/space_test_utils'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface GetTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/common/suites/update.ts similarity index 95% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/common/suites/update.ts index 51b8bc202c9fc..c4f941ef16f61 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/update.ts @@ -5,9 +5,9 @@ */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { getIdPrefix, getUrlPrefix } from '../../lib/space_test_utils'; -import { DescribeFn, TestDefinitionAuthentication } from '../../lib/types'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface UpdateTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts similarity index 95% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts index e984016185900..58456ac6debaa 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { bulkGetTestSuiteFactory } from '../../../common/suites/saved_objects/bulk_get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts index af05cdaa5f54c..09b40f238bae2 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { createTestSuiteFactory } from '../../../common/suites/saved_objects/create'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { createTestSuiteFactory } from '../../common/suites/create'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts index d5fe0cce52089..88031abf19311 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { deleteTestSuiteFactory } from '../../../common/suites/saved_objects/delete'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { deleteTestSuiteFactory } from '../../common/suites/delete'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts similarity index 98% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts index e9ec47f8ee56f..0d984d629240d 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { findTestSuiteFactory } from '../../../common/suites/saved_objects/find'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { findTestSuiteFactory } from '../../common/suites/find'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts index 0e6ecaeab96bf..96c2363aeff1b 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { getTestSuiteFactory } from '../../../common/suites/saved_objects/get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { getTestSuiteFactory } from '../../common/suites/get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts index 8dc2fec5190cd..2a65f56b523d7 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts @@ -3,19 +3,25 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; // tslint:disable:no-default-export -export default function({ loadTestFile, getService }: TestInvoker) { +export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); - describe('security and spaces enabled', () => { + describe('saved objects security and spaces enabled', () => { before(async () => { await createUsersAndRoles(es, supertest); }); - loadTestFile(require.resolve('./saved_objects')); + loadTestFile(require.resolve('./bulk_get')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts deleted file mode 100644 index b0f3ceb14e8a6..0000000000000 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts +++ /dev/null @@ -1,19 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { TestInvoker } from '../../../common/lib/types'; - -// tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('saved_objects', () => { - loadTestFile(require.resolve('./bulk_get')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./find')); - loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); - }); -} diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts index 720fef5fb62b3..62fc3b562e4c3 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { updateTestSuiteFactory } from '../../../common/suites/saved_objects/update'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { updateTestSuiteFactory } from '../../common/suites/update'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts index 07f5455cd8ae2..60aaf8b64d86d 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { bulkGetTestSuiteFactory } from '../../../common/suites/saved_objects/bulk_get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/create.ts index 0390bac48d4d5..21050effbdd99 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { createTestSuiteFactory } from '../../../common/suites/saved_objects/create'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { createTestSuiteFactory } from '../../common/suites/create'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/delete.ts index 3ff5a851c908a..634a3d60f1322 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { deleteTestSuiteFactory } from '../../../common/suites/saved_objects/delete'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { deleteTestSuiteFactory } from '../../common/suites/delete'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts similarity index 98% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/find.ts index 3b1d98a4f4fa3..84440d87275fb 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { findTestSuiteFactory } from '../../../common/suites/saved_objects/find'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { findTestSuiteFactory } from '../../common/suites/find'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/get.ts index d6ab9b1aae95d..c915450bb8a44 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { getTestSuiteFactory } from '../../../common/suites/saved_objects/get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { getTestSuiteFactory } from '../../common/suites/get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts index a4cc59af0b730..6c3a258112f4c 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts @@ -3,19 +3,25 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; // tslint:disable:no-default-export -export default function({ loadTestFile, getService }: TestInvoker) { +export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); - describe('security only enabled', () => { + describe('saved objects security only enabled', () => { before(async () => { await createUsersAndRoles(es, supertest); }); - loadTestFile(require.resolve('./saved_objects')); + loadTestFile(require.resolve('./bulk_get')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts deleted file mode 100644 index 1b1ae2c8a3c4d..0000000000000 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts +++ /dev/null @@ -1,25 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { TestInvoker } from '../../../common/lib/types'; - -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('saved_objects', () => { - loadTestFile(require.resolve('./bulk_get')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./find')); - loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); - }); -} diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/update.ts index 88b038f275606..ab967d6611a00 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { updateTestSuiteFactory } from '../../../common/suites/saved_objects/update'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { updateTestSuiteFactory } from '../../common/suites/update'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts similarity index 85% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts index 1f270bfd046d3..cfb4b301bccfb 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { bulkGetTestSuiteFactory } from '../../../common/suites/saved_objects/bulk_get'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts similarity index 87% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts index 488404e2bb86e..4da115377f23f 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { createTestSuiteFactory } from '../../../common/suites/saved_objects/create'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { createTestSuiteFactory } from '../../common/suites/create'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts similarity index 88% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts index d56124a903dd5..d70f930d63677 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { deleteTestSuiteFactory } from '../../../common/suites/saved_objects/delete'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { deleteTestSuiteFactory } from '../../common/suites/delete'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts similarity index 92% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts index 83403fdcea08b..51f4a8623667a 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { findTestSuiteFactory } from '../../../common/suites/saved_objects/find'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { findTestSuiteFactory } from '../../common/suites/find'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts similarity index 87% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts index 138dc82532a0a..d1f578808c6d5 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { getTestSuiteFactory } from '../../../common/suites/saved_objects/get'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { getTestSuiteFactory } from '../../common/suites/get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts index a1c07ab90e762..e3788a03c0e2e 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts @@ -4,17 +4,24 @@ * you may not use this file except in compliance with the Elastic License. */ +import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - // tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('apis spaces', () => { - loadTestFile(require.resolve('./saved_objects')); +export default function({ getService, loadTestFile }: TestInvoker) { + const es = getService('es'); + const supertest = getService('supertest'); + + describe('saved objects spaces only enabled', () => { + before(async () => { + await createUsersAndRoles(es, supertest); + }); + + loadTestFile(require.resolve('./bulk_get')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts deleted file mode 100644 index 1b1ae2c8a3c4d..0000000000000 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts +++ /dev/null @@ -1,25 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { TestInvoker } from '../../../common/lib/types'; - -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('saved_objects', () => { - loadTestFile(require.resolve('./bulk_get')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./find')); - loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); - }); -} diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts similarity index 88% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts index fe335489f7c8d..c22ef7fe17e13 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { updateTestSuiteFactory } from '../../../common/suites/saved_objects/update'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { updateTestSuiteFactory } from '../../common/suites/update'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) {