0
我正在寫一個API的測試,hmacsha1使用密鑰對整個獲取請求查詢字符串進行散列並將其發送到標題中。所以我需要在執行測試之前計算這個值,並將其設置在標題中。像這樣:RestAssured如何在mid語句中訪問查詢參數?
expect()
.statusCode(200)
.given()
.parameter("key", "abc")
.parameter("param2", "def")
.header("Authorization",hmacsha1(queryString,"secretKey"))
.when()
.get("/endpoint");
有沒有一種方法可以訪問「queryString」位置的當前查詢字符串?基本上它應該給我「key = abc & param2 = def」,這樣我就可以將它散列到原地。
非常感謝!