W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
在合同定義的頂級閉合中可以調(diào)用以下方法。request
和response
是必需的。priority
是可選的。
Groovy DSL。
org.springframework.cloud.contract.spec.Contract.make { // Definition of HTTP request part of the contract // (this can be a valid request or invalid depending // on type of contract being specified). request { method GET() url "/foo" //... } // Definition of HTTP response part of the contract // (a service implementing this contract should respond // with following response after receiving request // specified in "request" part above). response { status 200 //... } // Contract priority, which can be used for overriding // contracts (1 is highest). Priority is optional. priority 1 }
YAML。
priority: 8 request: ... response: ...
如果要使合同具有較高的優(yōu)先級,則需要將較低的數(shù)字傳遞給priority
標(biāo)簽/方法。例如,值5
的priority
的優(yōu)先級高于值10
的priority
。更高比priority
與{值4141 /}優(yōu)先級。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: