我们想在测试/ CI环境中(而不是在开发环境中)使scalac警告使我们的构建失败。我们在build.sbt中尝试过此操作:
I have used PATCH method in JMeter to update and API and I got Error 400: Bad Request in my response. I tested the json file in Postman and it is working properly.
I already have placed the content-Type=application/json in Header Manager, I also used the HttpClient4 in the Advance Tab but still get the Bad Request error.
Request:
PATCH https://<URL>/v1/markets/idn/entities/contacts
PATCH data:
{
"accountid": null,
"agentcode": null,
"assistantname": null,
"assistantphone": null,
"birthdate": null,
"citizenship": null,
"contactid": null,
"contactrole": "B|Beneficiary",
"createdbyid": null,
"createddate": "2018-02-28T17:00:00+00:00",
"customernumber": null,
"customertier": null,
"department": null,
"description": null,
"donotcall": true,
"email": null,
"externalid": null,
"fatcaindicator": "",
"fatcalastupdatedatetime": "2018-02-28T17:00:00+00:00",
"fax": null,
"firstname": null,
"gender": "F|Female",
"hasoptedoutofemail": true,
"hasoptedoutoffax": null,
"highesteducation": null,
"integrationkey": "A0003",
"jobtitle": null,
"lastmodifiedbyid": null,
"lastmodifieddate": "2018-02-28T17:00:00+00:00",
"lastname": null,
"leadsource": null,
"maritalstatus": "D|Divorce",
"mobilephone": null,
"name": null,
"nationality": null,
"occupation": null,
"phone": null,
"photourl": null,
"recordtypeid": null,
"salutation": null,
"sourcesystem": "CAS|CAS",
"status": "01|Active",
"telephone2": null,
"telephone3": null
}
[no cookies]
但是,这样做会导致测试 tree 中的警告导致构建失败(即使在开发环境中),但其他地方的警告则不会。
在测试环境中对所有代码启用致命警告的正确方法是什么?
答案 0 :(得分:-1)
如果引起警告的代码段位于开发环境中, 当您编译开发环境时,只会显示警告,但如果 导致警告的代码段在测试环境中,在这种情况下 您的测试将在编译时失败。
我认为仅在测试环境中很难拥有此选项。