-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
5f58a11
commit 31c680a
Showing
26 changed files
with
392 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ | |
"xpack", | ||
"observability" | ||
], | ||
"optionalPlugins": [ | ||
"licensing" | ||
], | ||
"ui": true, | ||
"server": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* 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 { createTestConfig } from '../common/config'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default createTestConfig({ | ||
license: 'basic', | ||
name: 'X-Pack APM API integration tests (basic)', | ||
testFiles: [require.resolve('./tests')], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
x-pack/test/apm_api_integration/basic/tests/annotations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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 expect from '@kbn/expect'; | ||
import { JsonObject } from 'src/plugins/kibana_utils/common'; | ||
import { FtrProviderContext } from '../../common/ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function annotationApiTests({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
|
||
function request({ method, url, data }: { method: string; url: string; data?: JsonObject }) { | ||
switch (method.toLowerCase()) { | ||
case 'post': | ||
return supertest | ||
.post(url) | ||
.send(data) | ||
.set('kbn-xsrf', 'foo'); | ||
|
||
default: | ||
throw new Error(`Unsupported methoed ${method}`); | ||
} | ||
} | ||
|
||
describe('APM annotations with a basic license', () => { | ||
describe('when creating an annotation', () => { | ||
it('fails with a 403 forbidden', async () => { | ||
const response = await request({ | ||
url: '/api/apm/services/opbeans-java/annotation', | ||
method: 'POST', | ||
data: { | ||
'@timestamp': new Date().toISOString(), | ||
message: 'New deployment', | ||
tags: ['foo'], | ||
service: { | ||
version: '1.1', | ||
environment: 'production', | ||
}, | ||
}, | ||
}); | ||
|
||
expect(response.status).to.be(403); | ||
expect(response.body.message).to.be( | ||
'Annotations require at least a gold license or a trial license.' | ||
); | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.