mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Reuse core-security-service createMockAuthenticatedUser
mock (#187426)
Follow up to https://github.com/elastic/kibana/pull/187318 Implement core `createMockAuthenticatedUser` in the security plugin mock to avoid divergence. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
482f2a9503
commit
ee80b740fa
3 changed files with 8 additions and 9 deletions
|
@ -7,12 +7,12 @@
|
|||
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { securityServiceMock } from '@kbn/core-security-server-mocks';
|
||||
|
||||
import { authenticationMock, authorizationMock } from './authentication/index.mock';
|
||||
import { navControlServiceMock } from './nav_control/index.mock';
|
||||
import { getUiApiMock } from './ui_api/index.mock';
|
||||
import { licenseMock } from '../common/licensing/index.mock';
|
||||
import type { MockAuthenticatedUserProps } from '../common/model/authenticated_user.mock';
|
||||
import { mockAuthenticatedUser } from '../common/model/authenticated_user.mock';
|
||||
|
||||
function createSetupMock() {
|
||||
return {
|
||||
|
@ -43,6 +43,5 @@ function createStartMock() {
|
|||
export const securityMock = {
|
||||
createSetup: createSetupMock,
|
||||
createStart: createStartMock,
|
||||
createMockAuthenticatedUser: (props: MockAuthenticatedUserProps = {}) =>
|
||||
mockAuthenticatedUser(props),
|
||||
createMockAuthenticatedUser: securityServiceMock.createMockAuthenticatedUser,
|
||||
};
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
import type { TransportResult } from '@elastic/elasticsearch';
|
||||
|
||||
import { securityServiceMock } from '@kbn/core-security-server-mocks';
|
||||
|
||||
import { auditServiceMock } from './audit/mocks';
|
||||
import { authenticationServiceMock } from './authentication/authentication_service.mock';
|
||||
import { authorizationMock } from './authorization/index.mock';
|
||||
import { userProfileServiceMock } from './user_profile/user_profile_service.mock';
|
||||
import { licenseMock } from '../common/licensing/index.mock';
|
||||
import { mockAuthenticatedUser } from '../common/model/authenticated_user.mock';
|
||||
import type { MockAuthenticatedUserProps } from '../common/model/authenticated_user.mock';
|
||||
|
||||
function createSetupMock() {
|
||||
const mockAuthz = authorizationMock.create();
|
||||
|
@ -79,6 +79,5 @@ export const securityMock = {
|
|||
createSetup: createSetupMock,
|
||||
createStart: createStartMock,
|
||||
createApiResponse: createApiResponseMock,
|
||||
createMockAuthenticatedUser: (props: MockAuthenticatedUserProps = {}) =>
|
||||
mockAuthenticatedUser(props),
|
||||
createMockAuthenticatedUser: securityServiceMock.createMockAuthenticatedUser,
|
||||
};
|
||||
|
|
|
@ -82,7 +82,8 @@
|
|||
"@kbn/core-user-profile-server",
|
||||
"@kbn/core-user-profile-browser",
|
||||
"@kbn/security-api-key-management",
|
||||
"@kbn/security-form-components"
|
||||
"@kbn/security-form-components",
|
||||
"@kbn/core-security-server-mocks",
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue