gpt4 book ai didi

java - JSR223 PreProcessor ScriptException : groovy. lang.MissingPropertyException:jmeter 中没有此类属性

转载 作者:行者123 更新时间:2023-12-01 16:59:12 25 4
gpt4 key购买 nike

我正在尝试使用 JSR223 预处理器在 JMeter 中实现下面的代码,但是面临标题中提到的问题。

public class G2bApiServletReturns extends GstUtil 
{

GstUtil gstutil = new GstUtil();
//generate EK using SEK in Auth response

String
SEK="L+Aafhigkjkvw6qkk3XT5TTQ4MbzEpjF+VoVHye8QFyq04bdtGOjvuHWvq3WQLfm";

byte[] EK = gstutil.decodeBase64StringTOByte(SEK);

String payload="Hello;

//Encrypted Payload



String encoded_json = GstUtil.encodeBase64String(payload);

String encrypted_json = gstutil.encrypt(encoded_json, EK);

//HMAC Value

String hmac = gstutil.generateHmac(encoded_json, EK);


}
log.info(hmac);

这是错误-

Problem in JSR223 script, JSR223 PreProcessor
javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: hmac for class

最佳答案

删除类声明:

 GstUtil gstutil = new GstUtil();
//generate EK using SEK in Auth response
String SEK="L+Aafhigkjkvw6qkk3XT5TTQ4MbzEpjF+VoVHye8QFyq04bdtGOjvuHWvq3WQLfm";
byte[] EK = gstutil.decodeBase64StringTOByte(SEK);
String payload="Hello;
//Encrypted Payload
String encoded_json = GstUtil.encodeBase64String(payload);
String encrypted_json = gstutil.encrypt(encoded_json, EK);
//HMAC Value
String hmac = gstutil.generateHmac(encoded_json, EK);
log.info(hmac);

关于java - JSR223 PreProcessor ScriptException : groovy. lang.MissingPropertyException:jmeter 中没有此类属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61538073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com