From f301c59486907f937f4a316f8a7294b057d49549 Mon Sep 17 00:00:00 2001 From: Cherry Wang Date: Tue, 27 Sep 2022 10:54:17 +0800 Subject: [PATCH] fix: Update status code to 400 when sending device profile with invalid units Signed-off-by: Cherry Wang --- .../deviceprofile/POST-Negative-Deviceresource.robot | 2 +- .../core-metadata/deviceprofile/POST-Negative-Uploadfile.robot | 2 +- .../V2-API/core-metadata/deviceprofile/POST-Negative.robot | 2 +- .../core-metadata/deviceprofile/PUT-Negative-UploadFile.robot | 2 +- .../V2-API/core-metadata/deviceprofile/PUT-Negative.robot | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot index c5037888..48f247ab 100644 --- a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot +++ b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot @@ -100,7 +100,7 @@ ErrProfileResourcePOST009 - Add deviceResource with invalid units value When Create Device Resources Contain invalid Units Value Then Should Return Status Code "207" And Should Return Content-Type "application/json" - And Item Index All Should Contain Status Code "500" + And Item Index All Should Contain Status Code "400" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resources Should Not Be Added in ${test_profile} [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false diff --git a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot index d268eddb..062b0182 100644 --- a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot +++ b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot @@ -86,7 +86,7 @@ ErrProfilePOSTUpload008 - Create device profile by upload file with deviceComman ErrProfilePOSTUpload009 - Create device profile by upload file with invalid units property Given Update Service Configuration On Consul ${uomValidationPath} true When Modify Device Profile Test-Profile-4 With invalid Units Value - Then Should Return Status Code "500" + Then Should Return Status Code "400" And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms [Teardown] Update Service Configuration On Consul ${uomValidationPath} false diff --git a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative.robot b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative.robot index d9f9d73e..f4606a46 100644 --- a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative.robot +++ b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/POST-Negative.robot @@ -93,6 +93,6 @@ ErrProfilePOST009 - Create device profile with invalid units value When Create A Profile Test-Profile-1 With invalid Units Value Then Should Return Status Code "207" And Should Return Content-Type "application/json" - And Item Index All Should Contain Status Code "500" + And Item Index All Should Contain Status Code "400" And Response Time Should Be Less Than "${default_response_time_threshold}"ms [Teardown] Update Service Configuration On Consul ${uomValidationPath} false diff --git a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot index fd94fbae..58d4f5cf 100644 --- a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot +++ b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot @@ -113,7 +113,7 @@ ErrProfilePUTUpload009 - Update device profile by upload file and the update fil And Update Service Configuration On Consul ${uomValidationPath} true And Update Units Value In Profile Test-Profile-3 To invalid When Upload File NEW-Test-Profile-3.yaml To Update Device Profile - Then Should Return Status Code "500" + Then Should Return Status Code "400" And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resource Units Should Not Be Updated in Test-Profile-3 diff --git a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative.robot b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative.robot index f333708a..bdd47c1e 100644 --- a/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative.robot +++ b/TAF/testScenarios/functionalTest/V2-API/core-metadata/deviceprofile/PUT-Negative.robot @@ -117,7 +117,7 @@ ErrProfilePUT009 - Update device profile with invalid units value And Set Profile Units Value To invalid When Update Device Profile ${deviceProfile} Then Should Return Status Code "207" - And Item Index 0 Should Contain Status Code "500" + And Item Index 0 Should Contain Status Code "400" And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resource Units Should Not Be Updated in Test-Profile-1