Skip to content

Commit

Permalink
Fix incorrect public test urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Oct 21, 2024
1 parent 1593634 commit b64b9a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
space.id
)}/public/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)}/api/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)
.auth(user.username, user.password);

Expand Down Expand Up @@ -186,7 +186,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
space.id
)}/public/alerting/rules/_find?per_page=${perPage}&sort_field=createdAt`
)}/api/alerting/rules/_find?per_page=${perPage}&sort_field=createdAt`
)
.auth(user.username, user.password);

Expand Down Expand Up @@ -235,7 +235,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
space.id
)}/public/alerting/rules/_find?per_page=${perPage}&sort_field=createdAt&page=2`
)}/api/alerting/rules/_find?per_page=${perPage}&sort_field=createdAt&page=2`
)
.auth(user.username, user.password);

Expand Down Expand Up @@ -282,7 +282,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
space.id
)}/public/alerting/rules/_find?filter=alert.attributes.actions:{ actionTypeId: test.noop }`
)}/api/alerting/rules/_find?filter=alert.attributes.actions:{ actionTypeId: test.noop }`
)
.auth(user.username, user.password);

Expand Down Expand Up @@ -382,7 +382,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
space.id
)}/public/alerting/rules/_find?filter=alert.attributes.alertTypeId:test.restricted-noop&fields=["tags"]&sort_field=createdAt`
)}/api/alerting/rules/_find?filter=alert.attributes.alertTypeId:test.restricted-noop&fields=["tags"]&sort_field=createdAt`
)
.auth(user.username, user.password);

Expand Down Expand Up @@ -459,7 +459,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
space.id
)}/public/alerting/rules/_find?filter=alert.attributes.alertTypeId:test.restricted-noop&fields=["tags","executionStatus"]&sort_field=createdAt`
)}/api/alerting/rules/_find?filter=alert.attributes.alertTypeId:test.restricted-noop&fields=["tags","executionStatus"]&sort_field=createdAt`
)
.auth(user.username, user.password);

Expand Down Expand Up @@ -516,7 +516,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
'other'
)}/public/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)}/api/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)
.auth(user.username, user.password);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)}/api/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
);

expect(response.status).to.eql(200);
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
.get(
`${getUrlPrefix(
Spaces.other.id
)}/public/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)}/api/alerting/rules/_find?search=test.noop&search_fields=alertTypeId`
)
.expect(200, {
page: 1,
Expand Down Expand Up @@ -182,7 +182,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?filter=alert.attributes.monitoring.run.calculated_metrics.success_ratio>50`
)}/api/alerting/rules/_find?filter=alert.attributes.monitoring.run.calculated_metrics.success_ratio>50`
);

expect(response.status).to.eql(400);
Expand All @@ -195,7 +195,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?sort_field=monitoring.run.calculated_metrics.success_ratio`
)}/api/alerting/rules/_find?sort_field=monitoring.run.calculated_metrics.success_ratio`
);

expect(response.status).to.eql(200);
Expand All @@ -208,7 +208,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?search_fields=monitoring.run.calculated_metrics.success_ratio&search=50`
)}/api/alerting/rules/_find?search_fields=monitoring.run.calculated_metrics.success_ratio&search=50`
);

expect(response.status).to.eql(400);
Expand All @@ -221,7 +221,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?filter=alert.attributes.params.strValue:"my b"`
)}/api/alerting/rules/_find?filter=alert.attributes.params.strValue:"my b"`
);

expect(response.status).to.eql(200);
Expand All @@ -231,7 +231,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {

it('should filter on kueryNode parameters', async () => {
const response = await supertest.get(
`${getUrlPrefix(Spaces.space1.id)}/public/alerting/rules/_find?filter=${JSON.stringify(
`${getUrlPrefix(Spaces.space1.id)}/api/alerting/rules/_find?filter=${JSON.stringify(
fromKueryExpression('alert.attributes.params.strValue:"my b"')
)}`
);
Expand All @@ -245,7 +245,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?sort_field=params.severity&sort_order=asc`
)}/api/alerting/rules/_find?sort_field=params.severity&sort_order=asc`
);
expect(response.body.data[0].params.severity).to.equal('low');
expect(response.body.data[1].params.severity).to.equal('medium');
Expand All @@ -256,7 +256,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?search_fields=params.severity&search=medium`
)}/api/alerting/rules/_find?search_fields=params.severity&search=medium`
);

expect(response.status).to.eql(200);
Expand All @@ -268,7 +268,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?filter=alert.attributes.params.risk_score:40`
)}/api/alerting/rules/_find?filter=alert.attributes.params.risk_score:40`
);

expect(response.status).to.eql(200);
Expand All @@ -282,7 +282,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const response = await supertest.get(
`${getUrlPrefix(
Spaces.space1.id
)}/public/alerting/rules/_find?filter=alert.attributes.mapped_params.risk_score:40`
)}/api/alerting/rules/_find?filter=alert.attributes.mapped_params.risk_score:40`
);

expect(response.status).to.eql(400);
Expand Down

0 comments on commit b64b9a9

Please sign in to comment.