From be6696f114b928c1444c18e6938794283907e963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Fri, 14 Aug 2020 08:55:39 +0100 Subject: [PATCH] Adding API test for custom link transaction example (#74238) * Adding api test for custom link transaction example * expecting specific fields * expecting specific fields Co-authored-by: Elastic Machine --- .../basic/tests/settings/custom_link.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts b/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts index 9465708db2fba..2acc6522bf479 100644 --- a/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts +++ b/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts @@ -12,6 +12,7 @@ export default function customLinksTests({ getService }: FtrProviderContext) { const supertestRead = getService('supertestAsApmReadUser'); const supertestWrite = getService('supertestAsApmWriteUser'); const log = getService('log'); + const esArchiver = getService('esArchiver'); function searchCustomLinks(filters?: any) { const path = URL.format({ @@ -139,5 +140,18 @@ export default function customLinksTests({ getService }: FtrProviderContext) { expect(status).to.equal(200); expect(body).to.eql([]); }); + + describe('transaction', () => { + before(() => esArchiver.load('8.0.0')); + after(() => esArchiver.unload('8.0.0')); + + it('fetches a transaction sample', async () => { + const response = await supertestRead.get( + '/api/apm/settings/custom_links/transaction?service.name=opbeans-java' + ); + expect(response.status).to.be(200); + expect(response.body.service.name).to.eql('opbeans-java'); + }); + }); }); }