Skip to content

Commit

Permalink
delete injectXpackSignature and related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Sep 1, 2020
1 parent 971b835 commit 387d1c4
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 265 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { BehaviorSubject } from 'rxjs';
import sinon from 'sinon';
import { XPackInfo } from '../xpack_info';
import { setupXPackMain } from '../setup_xpack_main';
import * as InjectXPackInfoSignatureNS from '../inject_xpack_info_signature';

describe('setupXPackMain()', () => {
const sandbox = sinon.createSandbox();
Expand All @@ -19,7 +18,6 @@ describe('setupXPackMain()', () => {

beforeEach(() => {
sandbox.useFakeTimers();
sandbox.stub(InjectXPackInfoSignatureNS, 'injectXPackInfoSignature');

mockElasticsearchPlugin = {
getCluster: sinon.stub(),
Expand Down Expand Up @@ -63,29 +61,9 @@ describe('setupXPackMain()', () => {
setupXPackMain(mockServer);

sinon.assert.calledWithExactly(mockServer.expose, 'info', sinon.match.instanceOf(XPackInfo));
sinon.assert.calledWithExactly(mockServer.ext, 'onPreResponse', sinon.match.func);
sinon.assert.calledWithExactly(mockElasticsearchPlugin.status.on, 'change', sinon.match.func);
});

it('onPreResponse hook calls `injectXPackInfoSignature` for every request.', () => {
setupXPackMain(mockServer);

const xPackInfo = mockServer.expose.firstCall.args[1];
const onPreResponse = mockServer.ext.firstCall.args[1];

const mockRequest = {};
const mockReply = sinon.stub();

onPreResponse(mockRequest, mockReply);

sinon.assert.calledWithExactly(
InjectXPackInfoSignatureNS.injectXPackInfoSignature,
xPackInfo,
sinon.match.same(mockRequest),
sinon.match.same(mockReply)
);
});

describe('Elasticsearch plugin state changes cause XPackMain plugin state change.', () => {
let xPackInfo;
let onElasticsearchPluginStatusChange;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { injectXPackInfoSignature } from './inject_xpack_info_signature';
import { XPackInfo } from './xpack_info';

/**
Expand All @@ -20,8 +19,6 @@ export function setupXPackMain(server) {

server.expose('info', info);

server.ext('onPreResponse', (request, h) => injectXPackInfoSignature(info, request, h));

const setPluginStatus = () => {
if (info.isAvailable()) {
server.plugins.xpack_main.status.green('Ready');
Expand Down
1 change: 0 additions & 1 deletion x-pack/scripts/functional_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const onlyNotInCoverageTests = [
require.resolve('../test/upgrade_assistant_integration/config.js'),
require.resolve('../test/licensing_plugin/config.ts'),
require.resolve('../test/licensing_plugin/config.public.ts'),
require.resolve('../test/licensing_plugin/config.legacy.ts'),
require.resolve('../test/endpoint_api_integration_no_ingest/config.ts'),
require.resolve('../test/reporting_api_integration/reporting_and_security.config.ts'),
require.resolve('../test/reporting_api_integration/reporting_without_security.config.ts'),
Expand Down
15 changes: 0 additions & 15 deletions x-pack/test/licensing_plugin/config.legacy.ts

This file was deleted.

16 changes: 0 additions & 16 deletions x-pack/test/licensing_plugin/legacy/index.ts

This file was deleted.

58 changes: 0 additions & 58 deletions x-pack/test/licensing_plugin/legacy/updates.ts

This file was deleted.

0 comments on commit 387d1c4

Please sign in to comment.