第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將 JMeter 中的兩個值與 JSR223 斷言進行比較

將 JMeter 中的兩個值與 JSR223 斷言進行比較

至尊寶的傳說 2021-10-17 15:44:49
我一直在挖掘,以便為這個問題找到解決方案。我終于找到了這篇文章:https : //blog.softwaremill.com/who-am-i-keycloak-impersonation-api-bfe7acaf051a??傊?,在我的情況下,我做了:在 Keycloak 中創(chuàng)建服務客戶端(啟用直接訪問授權;啟用服務帳戶):向客戶端添加模擬角色;調用REST API生成中間令牌;# Getting intermediate tokencurl --location --request POST 'http://localhost:8080/auth/realms/MY_REALM/protocol/openid-connect/token' \--header 'Content-Type: application/x-www-form-urlencoded' \--data-urlencode 'client_id=vanilla' \--data-urlencode 'client_secret=c41da386-b4fc-4202-b799-53196284e44f' \--data-urlencode 'grant_type=client_credentials'調用 REST API 將令牌交換為模擬訪問令牌;Impersonated user Access-Tokencurl --location --request POST 'http://localhost:8080/auth/realms/MY_REALM/protocol/openid-connect/token' \--header 'Content-Type: application/x-www-form-urlencoded' \--data-urlencode 'client_id=vanilla' \--data-urlencode 'client_secret=c41da386-b4fc-4202-b799-53196284e44f' \--data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:token-exchange' \--data-urlencode 'subject_token=<ACCESS_TOKEN_FROM_PREVIOUS_STEP_2> \--data-urlencode 'requested_token_type=urn:ietf:params:oauth:token-type:access_token' \--data-urlencode 'requested_subject=34307875-39a6-4828-8cf0-f59f403bd51f'使用令牌訪問所需的資源;例如curl --location --request GET 'http://localhost:8090/todos' \--header 'Authorization: Bearer <ACCESS_TOKEN_FROM_PREVIOUS_STEP_3>'注意:必須為交換令牌啟用 Keycloak 服務器:未實現(xiàn) Keycloak 模擬 API
查看完整描述

1 回答

?
ITMISS

TA貢獻1871條經驗 獲得超8個贊

您的代碼適用于具有Failure可用變量的Beanshell 斷言

但是對于JSR223 斷言,只需使用以下行:

 AssertionResult.setFailure(true);

如果檢測到錯誤,腳本應使用 AssertionResult.setFailureMessage("message") 和 AssertionResult.setFailure(true)。


查看完整回答
反對 回復 2021-10-17
  • 1 回答
  • 0 關注
  • 527 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號