From 63414c1f9eeca81339d1e48cf0cab7f290e98e3f Mon Sep 17 00:00:00 2001 From: Quynh Nguyen Date: Thu, 30 Jul 2020 09:52:49 -0500 Subject: [PATCH] [ML] Fix commonAnnotationUpdateRequestBody --- .../apis/ml/annotations/create_annotations.ts | 2 +- .../apis/ml/annotations/update_annotations.ts | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts b/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts index a71a2959d25ed..14ecf1bfe524e 100644 --- a/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts +++ b/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts @@ -54,7 +54,7 @@ export default ({ getService }: FtrProviderContext) => { expect(fetchedAnnotation?.create_username).to.eql(USER.ML_POWERUSER); }); - it('should successfully create annotation for user without required permission', async () => { + it('should successfully create annotation for user with ML read permissions', async () => { const { body } = await supertest .put('/api/ml/annotations/index') .auth(USER.ML_VIEWER, ml.securityCommon.getPasswordForUser(USER.ML_VIEWER)) diff --git a/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts b/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts index a3cbfb28aee10..ba73617151120 100644 --- a/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts +++ b/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts @@ -86,11 +86,6 @@ export default ({ getService }: FtrProviderContext) => { const annotationUpdateRequestBody = { ...commonAnnotationUpdateRequestBody, job_id: originalAnnotation._source.job_id, - type: ANNOTATION_TYPE.ANNOTATION, - event: 'model_change', - detector_index: 2, - partition_field_name: 'airline', - partition_field_value: 'ANA', _id: originalAnnotation._id, }; @@ -120,15 +115,8 @@ export default ({ getService }: FtrProviderContext) => { const originalAnnotation = annotationsForJob[0]; const annotationUpdateRequestBody = { - timestamp: Date.now(), - end_timestamp: Date.now(), - annotation: 'Updated annotation', + ...commonAnnotationUpdateRequestBody, job_id: originalAnnotation._source.job_id, - type: ANNOTATION_TYPE.ANNOTATION, - event: 'model_change', - detector_index: 2, - partition_field_name: 'airline', - partition_field_value: 'ANA', _id: originalAnnotation._id, };