Skip to content

Commit

Permalink
Adding functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Oct 26, 2020
1 parent 6349bcd commit d247bf0
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,22 @@ export default function createGetTests({ getService }: FtrProviderContext) {
],
});
});

it('7.11.0 migrates webhook connector configurations to have `hasAuth` property', async () => {
const responseWithAuth = await supertest.get(
`${getUrlPrefix(``)}/api/actions/action/949f909b-20a0-46e3-aadb-6a4d117bb592`
);

expect(responseWithAuth.status).to.eql(200);
expect(responseWithAuth.body.config).key('hasAuth');
expect(responseWithAuth.body.config.hasAuth).to.eql(true);

const responseNoAuth = await supertest.get(
`${getUrlPrefix(``)}/api/actions/action/7434121e-045a-47d6-a0a6-0b6da752397a`
);
expect(responseNoAuth.status).to.eql(200);
expect(responseNoAuth.body.config).key('hasAuth');
expect(responseNoAuth.body.config.hasAuth).to.eql(false);
});
});
}
54 changes: 54 additions & 0 deletions x-pack/test/functional/es_archives/actions/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,57 @@
"type": "_doc"
}
}

{
"type": "doc",
"value": {
"id": "action:949f909b-20a0-46e3-aadb-6a4d117bb592",
"index": ".kibana_1",
"source": {
"action": {
"actionTypeId": ".webhook",
"config": {
"headers": null,
"method": "post",
"url": "http://localhost"
},
"name": "A webhook with auth",
"secrets": "LUqlrITACjqPmcWGlbl+H4RsGGOlw8LM0Urq8r7y6jNT7Igv3J7FjKJ2NXfNTaghVBO7e9x3wZOtiycwyoAdviTyYm1pspni24vH+OT70xaSuXcDoxfGwiLEcaG04INDnUJX4dtmRerxqR9ChktC70LNtOU3sqjYI2tWt2vOqGeq"
},
"migrationVersion": {
"action": "7.10.0"
},
"references": [
],
"type": "action",
"updated_at": "2020-10-26T21:29:47.380Z"
}
}
}

{
"type": "doc",
"value": {
"id": "action:7434121e-045a-47d6-a0a6-0b6da752397a",
"index": ".kibana_1",
"source": {
"action": {
"actionTypeId": ".webhook",
"config": {
"headers": null,
"method": "post",
"url": "http://localhost"
},
"name": "A webhook with no auth",
"secrets": "tOwFq20hbUrcp3FX7stKB5aJaQQdLNQwomSNym8BgnFaBBafPOASv5T0tGdGsTr/CA7VK+N/wYBHQPzt0apF8Z/UYl63ZXqck5tSoFDnQW77zv1VVQ5wEwN1qkAQQcfrXTXU2wYVAYZNSuHkbeRjcasfG0ty1K+J7A=="
},
"migrationVersion": {
"action": "7.10.0"
},
"references": [
],
"type": "action",
"updated_at": "2020-10-26T21:30:35.146Z"
}
}
}

0 comments on commit d247bf0

Please sign in to comment.